mirror of
https://github.com/element-hq/synapse.git
synced 2025-12-28 14:59:12 +00:00
Move start_doing_background_updates() to SynapseHomeServer.start_background_tasks() (#19036)
(more sane standard location for this sort of thing) The one difference here is that previously, `start_doing_background_updates ()` only ran on the main Synapse instance. But since it now lives in `start_background_tasks()`, it will run on the worker that supposed to `run_background_tasks`. Doesn't seem like a problem though.
This commit is contained in:
parent
9d9275da5a
commit
d399d7649a
1
changelog.d/19036.misc
Normal file
1
changelog.d/19036.misc
Normal file
@ -0,0 +1 @@
|
||||
Move `start_doing_background_updates()` to `SynapseHomeServer.start_background_tasks()`.
|
||||
@ -317,6 +317,11 @@ class SynapseHomeServer(HomeServer):
|
||||
# during parsing
|
||||
logger.warning("Unrecognized listener type: %s", listener.type)
|
||||
|
||||
def start_background_tasks(self) -> None:
|
||||
super().start_background_tasks()
|
||||
|
||||
self.get_datastores().main.db_pool.updates.start_doing_background_updates()
|
||||
|
||||
|
||||
def load_or_generate_config(argv_options: List[str]) -> HomeServerConfig:
|
||||
"""
|
||||
@ -430,11 +435,6 @@ def setup(
|
||||
|
||||
await _base.start(hs, freeze)
|
||||
|
||||
# TODO: This should be moved to `SynapseHomeServer.start_background_tasks` (not
|
||||
# `HomeServer.start_background_tasks`) (this way it matches the behavior of only
|
||||
# running on `main`)
|
||||
hs.get_datastores().main.db_pool.updates.start_doing_background_updates()
|
||||
|
||||
# Register a callback to be invoked once the reactor is running
|
||||
register_start(hs, _start_when_reactor_running)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user