Move some replication processing out of generic_worker (#9796)

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
Erik Johnston 2021-04-14 17:06:06 +01:00 committed by GitHub
parent c9a2b5d402
commit 00a6db9676
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 486 additions and 483 deletions

View file

@ -85,7 +85,11 @@ from synapse.handlers.initial_sync import InitialSyncHandler
from synapse.handlers.message import EventCreationHandler, MessageHandler
from synapse.handlers.pagination import PaginationHandler
from synapse.handlers.password_policy import PasswordPolicyHandler
from synapse.handlers.presence import PresenceHandler
from synapse.handlers.presence import (
BasePresenceHandler,
PresenceHandler,
WorkerPresenceHandler,
)
from synapse.handlers.profile import ProfileHandler
from synapse.handlers.read_marker import ReadMarkerHandler
from synapse.handlers.receipts import ReceiptsHandler
@ -415,8 +419,11 @@ class HomeServer(metaclass=abc.ABCMeta):
return StateResolutionHandler(self)
@cache_in_self
def get_presence_handler(self) -> PresenceHandler:
return PresenceHandler(self)
def get_presence_handler(self) -> BasePresenceHandler:
if self.config.worker_app:
return WorkerPresenceHandler(self)
else:
return PresenceHandler(self)
@cache_in_self
def get_typing_writer_handler(self) -> TypingWriterHandler: