浏览代码

Don't reuse cache locks between instances of class

Unrud 7 年之前
父节点
当前提交
6e73a1bebf
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      radicale/storage.py

+ 4 - 3
radicale/storage.py

@@ -761,6 +761,10 @@ class Collection(BaseCollection):
             "storage", "filesystem_close_lock_file")
         cls._lock = FileBackedRwLock(lock_path, close_lock_file)
 
+        # init cache lock
+        cls._cache_locks = {}
+        cls._cache_locks_lock = threading.Lock()
+
     def __init__(self, path, principal=None, folder=None,
                  filesystem_path=None):
         # DEPRECATED: Remove principal and folder attributes
@@ -1309,9 +1313,6 @@ class Collection(BaseCollection):
             pass
         return content
 
-    _cache_locks = {}
-    _cache_locks_lock = threading.Lock()
-
     @contextmanager
     def _acquire_cache_lock(self, ns=""):
         if "/" in ns: