diff options
author | Erik Johnston <erik@matrix.org> | 2017-03-10 11:22:25 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-03-10 11:22:25 +0000 |
commit | 8f267fa8a8d6cf50383a6a05c26b83dee06076fb (patch) | |
tree | f6fcf9459c645fd95e4a326cbe990b9e6e3fe9d4 /synapse/replication/slave | |
parent | Noop repated delete device inbox calls from /sync (diff) | |
download | synapse-8f267fa8a8d6cf50383a6a05c26b83dee06076fb.tar.xz |
Fix it for the workers
Diffstat (limited to 'synapse/replication/slave')
-rw-r--r-- | synapse/replication/slave/storage/deviceinbox.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/replication/slave/storage/deviceinbox.py b/synapse/replication/slave/storage/deviceinbox.py index cc860f9f9b..f9102e0d89 100644 --- a/synapse/replication/slave/storage/deviceinbox.py +++ b/synapse/replication/slave/storage/deviceinbox.py @@ -17,6 +17,7 @@ from ._base import BaseSlavedStore from ._slaved_id_tracker import SlavedIdTracker from synapse.storage import DataStore from synapse.util.caches.stream_change_cache import StreamChangeCache +from synapse.util.caches.expiringcache import ExpiringCache class SlavedDeviceInboxStore(BaseSlavedStore): @@ -34,6 +35,13 @@ class SlavedDeviceInboxStore(BaseSlavedStore): self._device_inbox_id_gen.get_current_token() ) + self._last_device_delete_cache = ExpiringCache( + cache_name="last_device_delete_cache", + clock=self._clock, + max_len=10000, + expiry_ms=30 * 60 * 1000, + ) + get_to_device_stream_token = DataStore.get_to_device_stream_token.__func__ get_new_messages_for_device = DataStore.get_new_messages_for_device.__func__ get_new_device_msgs_for_remote = DataStore.get_new_device_msgs_for_remote.__func__ |