summary refs log tree commit diff
path: root/synapse/storage/stats.py
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-27 14:59:39 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-27 15:00:16 +0100
commit064143c1308cf6354554702d5041ec4bd3ac8ff8 (patch)
tree05eb5bab6ff5e389c3a11c9fe72f6fefe462447f /synapse/storage/stats.py
parentFix logic error. (diff)
downloadsynapse-064143c1308cf6354554702d5041ec4bd3ac8ff8.tar.xz
Use `DeferredLock` instead of `threading.Lock`
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Diffstat (limited to '')
-rw-r--r--synapse/storage/stats.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py
index ede5002fca..c9687c29d2 100644
--- a/synapse/storage/stats.py
+++ b/synapse/storage/stats.py
@@ -16,7 +16,8 @@
 
 import logging
 from itertools import chain
-from threading import Lock
+
+from twisted.internet.defer import DeferredLock
 
 from synapse.storage.state_deltas import StateDeltasStore
 from synapse.util.caches.descriptors import cached
@@ -57,7 +58,7 @@ class StatsStore(StateDeltasStore):
         self.stats_enabled = hs.config.stats_enabled
         self.stats_bucket_size = hs.config.stats_bucket_size
 
-        self.stats_delta_processing_lock = Lock()
+        self.stats_delta_processing_lock = DeferredLock()
 
         self.register_noop_background_update("populate_stats_createtables")
         self.register_noop_background_update("populate_stats_process_rooms")