mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-26 23:05:19 -04:00
Remove slaved id tracker (#14376)
This matches the multi instance writer ID generator class which can both handle advancing the current token over replication and by calling the database.
This commit is contained in:
parent
e226513c0f
commit
36097e88c4
11 changed files with 74 additions and 176 deletions
|
@ -27,7 +27,6 @@ from typing import (
|
|||
)
|
||||
|
||||
from synapse.push import PusherConfig, ThrottleParams
|
||||
from synapse.replication.slave.storage._slaved_id_tracker import SlavedIdTracker
|
||||
from synapse.replication.tcp.streams import PushersStream
|
||||
from synapse.storage._base import SQLBaseStore, db_to_json
|
||||
from synapse.storage.database import (
|
||||
|
@ -59,20 +58,15 @@ class PusherWorkerStore(SQLBaseStore):
|
|||
):
|
||||
super().__init__(database, db_conn, hs)
|
||||
|
||||
if hs.config.worker.worker_app is None:
|
||||
self._pushers_id_gen: AbstractStreamIdTracker = StreamIdGenerator(
|
||||
db_conn,
|
||||
"pushers",
|
||||
"id",
|
||||
extra_tables=[("deleted_pushers", "stream_id")],
|
||||
)
|
||||
else:
|
||||
self._pushers_id_gen = SlavedIdTracker(
|
||||
db_conn,
|
||||
"pushers",
|
||||
"id",
|
||||
extra_tables=[("deleted_pushers", "stream_id")],
|
||||
)
|
||||
# In the worker store this is an ID tracker which we overwrite in the non-worker
|
||||
# class below that is used on the main process.
|
||||
self._pushers_id_gen: AbstractStreamIdTracker = StreamIdGenerator(
|
||||
db_conn,
|
||||
"pushers",
|
||||
"id",
|
||||
extra_tables=[("deleted_pushers", "stream_id")],
|
||||
is_writer=hs.config.worker.worker_app is None,
|
||||
)
|
||||
|
||||
self.db_pool.updates.register_background_update_handler(
|
||||
"remove_deactivated_pushers",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue