diff options
author | Erik Johnston <erikj@matrix.org> | 2023-09-14 16:20:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 16:20:47 +0100 |
commit | 329597022ee02516e5cbee11fcd566e05609b724 (patch) | |
tree | 386ca9ea5f6d47308a8832f009da92f0e6754917 /synapse/replication | |
parent | Speed up deleting to-device messages task (#16318) (diff) | |
download | synapse-329597022ee02516e5cbee11fcd566e05609b724.tar.xz |
Some minor performance fixes for task schedular (#16313)
Diffstat (limited to 'synapse/replication')
-rw-r--r-- | synapse/replication/tcp/handler.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/replication/tcp/handler.py b/synapse/replication/tcp/handler.py index 5642666411..b668bb5da1 100644 --- a/synapse/replication/tcp/handler.py +++ b/synapse/replication/tcp/handler.py @@ -672,14 +672,12 @@ class ReplicationCommandHandler: cmd.instance_name, cmd.lock_name, cmd.lock_key ) - async def on_NEW_ACTIVE_TASK( + def on_NEW_ACTIVE_TASK( self, conn: IReplicationConnection, cmd: NewActiveTaskCommand ) -> None: """Called when get a new NEW_ACTIVE_TASK command.""" if self._task_scheduler: - task = await self._task_scheduler.get_task(cmd.data) - if task: - await self._task_scheduler._launch_task(task) + self._task_scheduler.launch_task_by_id(cmd.data) def new_connection(self, connection: IReplicationConnection) -> None: """Called when we have a new connection.""" |