diff options
author | David Robertson <davidr@element.io> | 2021-11-15 15:41:32 +0000 |
---|---|---|
committer | David Robertson <davidr@element.io> | 2021-11-16 18:46:51 +0000 |
commit | 1dea20ca75476cce6a72d790868b127d945bd769 (patch) | |
tree | 175a798c84cc5989be75bb3e508f60aed8b8fbc3 | |
parent | LoggingDatabaseConnection.__enter__ returns itself (diff) | |
download | synapse-1dea20ca75476cce6a72d790868b127d945bd769.tar.xz |
CacheInvalidationWorkerStore needs RelationsWorkerStore
for e.g. get_relations_for_event. Remove it from SlavedEventsStore. (Still there via SlavedEventsStore -> BaseSlavedStore -> CacheInvalidationWorkerStore -> RelationsWorkerStore.
-rw-r--r-- | synapse/replication/slave/storage/events.py | 1 | ||||
-rw-r--r-- | synapse/storage/databases/main/cache.py | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/synapse/replication/slave/storage/events.py b/synapse/replication/slave/storage/events.py index 6080d9fb29..5856425c17 100644 --- a/synapse/replication/slave/storage/events.py +++ b/synapse/replication/slave/storage/events.py @@ -52,7 +52,6 @@ class SlavedEventStore( StreamWorkerStore, StateGroupWorkerStore, UserErasureWorkerStore, - RelationsWorkerStore, BaseSlavedStore, ): def __init__(self, database: DatabasePool, db_conn, hs: "HomeServer"): diff --git a/synapse/storage/databases/main/cache.py b/synapse/storage/databases/main/cache.py index 41eec27427..d5fab29905 100644 --- a/synapse/storage/databases/main/cache.py +++ b/synapse/storage/databases/main/cache.py @@ -30,6 +30,7 @@ from synapse.storage.database import ( LoggingTransaction, ) from synapse.storage.databases.main.event_federation import EventFederationWorkerStore +from synapse.storage.databases.main.relations import RelationsWorkerStore from synapse.storage.engines import PostgresEngine from synapse.storage.util.id_generators import MultiWriterIdGenerator from synapse.util.caches.descriptors import _CachedFunction @@ -49,7 +50,7 @@ CURRENT_STATE_CACHE_NAME = "cs_cache_fake" _CacheData = Tuple[str, Optional[List[str]], Optional[int]] -class CacheInvalidationWorkerStore(EventFederationWorkerStore): +class CacheInvalidationWorkerStore(EventFederationWorkerStore, RelationsWorkerStore): # This class must be mixed in with a child class which provides the following # attribute. TODO: can we get static analysis to enforce this? _cache_id_gen: Optional[MultiWriterIdGenerator] |