mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-13 06:32:16 -04:00
Use symbolic names for replication stream names (#7768)
This makes it much easier to find where streams are referenced.
This commit is contained in:
parent
a6eae69ffe
commit
f01e2ca039
11 changed files with 27 additions and 22 deletions
|
@ -19,7 +19,9 @@ import logging
|
|||
from typing import Any, Iterable, Optional, Tuple
|
||||
|
||||
from synapse.api.constants import EventTypes
|
||||
from synapse.replication.tcp.streams import BackfillStream, CachesStream
|
||||
from synapse.replication.tcp.streams.events import (
|
||||
EventsStream,
|
||||
EventsStreamCurrentStateRow,
|
||||
EventsStreamEventRow,
|
||||
)
|
||||
|
@ -71,10 +73,10 @@ class CacheInvalidationWorkerStore(SQLBaseStore):
|
|||
)
|
||||
|
||||
def process_replication_rows(self, stream_name, instance_name, token, rows):
|
||||
if stream_name == "events":
|
||||
if stream_name == EventsStream.NAME:
|
||||
for row in rows:
|
||||
self._process_event_stream_row(token, row)
|
||||
elif stream_name == "backfill":
|
||||
elif stream_name == BackfillStream.NAME:
|
||||
for row in rows:
|
||||
self._invalidate_caches_for_event(
|
||||
-token,
|
||||
|
@ -86,7 +88,7 @@ class CacheInvalidationWorkerStore(SQLBaseStore):
|
|||
row.relates_to,
|
||||
backfilled=True,
|
||||
)
|
||||
elif stream_name == "caches":
|
||||
elif stream_name == CachesStream.NAME:
|
||||
if self._cache_id_gen:
|
||||
self._cache_id_gen.advance(instance_name, token)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue