Add option to close lock file
Close the lock file, when no more clients are waiting. This option is not very useful in general, but on Windows files that are opened cannot be deleted. This causes tests to fail, because the deletion of the temporary filesystem folder fails.
This commit is contained in:
parent
35d12ee97e
commit
3f5dd70580
@ -59,7 +59,8 @@ INITIAL_CONFIG = {
|
||||
"filesystem_folder": os.path.expanduser(
|
||||
"~/.config/radicale/collections"),
|
||||
"fsync": "True",
|
||||
"hook": ""},
|
||||
"hook": "",
|
||||
"close_lock_file": "False"},
|
||||
"logging": {
|
||||
"config": "/etc/radicale/logging",
|
||||
"debug": "False",
|
||||
|
@ -802,3 +802,7 @@ class Collection(BaseCollection):
|
||||
cls._lock_file_locked = False
|
||||
if cls._waiters:
|
||||
cls._waiters[0].notify()
|
||||
if (cls.configuration.getboolean("storage", "close_lock_file")
|
||||
and cls._readers == 0 and not cls._waiters):
|
||||
cls._lock_file.close()
|
||||
cls._lock_file = None
|
Loading…
Reference in New Issue
Block a user