1
0

Move start_doing_background_updates() to HomeServer.start_background_tasks()

This commit is contained in:
Eric Eastwood
2025-10-13 13:46:15 -05:00
parent ec7554b768
commit 4cf90e13fa
2 changed files with 4 additions and 5 deletions

View File

@@ -317,11 +317,6 @@ 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:
"""

View File

@@ -640,12 +640,16 @@ class HomeServer(metaclass=abc.ABCMeta):
Some handlers have side effects on instantiation (like registering
background updates). This function causes them to be fetched, and
therefore instantiated, to run those side effects.
We assume these background tasks are only run on a single Synapse instance at a
time.
"""
for i in self.REQUIRED_ON_BACKGROUND_TASK_STARTUP:
getattr(self, "get_" + i + "_handler")()
self.get_task_scheduler()
self.get_common_usage_metrics_manager().setup()
start_phone_stats_home(self)
self.get_datastores().main.db_pool.updates.start_doing_background_updates()
def get_reactor(self) -> ISynapseReactor:
"""