Merge pull request #476 from Unrud/closelockfile
Add option to close lock file
This commit is contained in:
commit
e66a35e996
@ -59,7 +59,8 @@ INITIAL_CONFIG = {
|
|||||||
"filesystem_folder": os.path.expanduser(
|
"filesystem_folder": os.path.expanduser(
|
||||||
"~/.config/radicale/collections"),
|
"~/.config/radicale/collections"),
|
||||||
"fsync": "True",
|
"fsync": "True",
|
||||||
"hook": ""},
|
"hook": "",
|
||||||
|
"close_lock_file": "False"},
|
||||||
"logging": {
|
"logging": {
|
||||||
"config": "/etc/radicale/logging",
|
"config": "/etc/radicale/logging",
|
||||||
"debug": "False",
|
"debug": "False",
|
||||||
|
@ -793,3 +793,7 @@ class Collection(BaseCollection):
|
|||||||
cls._lock_file_locked = False
|
cls._lock_file_locked = False
|
||||||
if cls._waiters:
|
if cls._waiters:
|
||||||
cls._waiters[0].notify()
|
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
|
@ -813,6 +813,8 @@ class BaseFileSystemTest(BaseTest):
|
|||||||
self.configuration.set("storage", "filesystem_folder", self.colpath)
|
self.configuration.set("storage", "filesystem_folder", self.colpath)
|
||||||
# Disable syncing to disk for better performance
|
# Disable syncing to disk for better performance
|
||||||
self.configuration.set("storage", "fsync", "False")
|
self.configuration.set("storage", "fsync", "False")
|
||||||
|
# Required on Windows, doesn't matter on Unix
|
||||||
|
self.configuration.set("storage", "close_lock_file", "True")
|
||||||
self.application = Application(self.configuration, self.logger)
|
self.application = Application(self.configuration, self.logger)
|
||||||
|
|
||||||
def teardown(self):
|
def teardown(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user