Rename WorkerProfileHandler to BaseProfileHandler

This commit is contained in:
Erik Johnston 2018-08-22 10:13:40 +01:00
parent a81f140880
commit 8432e2ebd7
2 changed files with 12 additions and 5 deletions

View File

@ -32,9 +32,16 @@ from ._base import BaseHandler
logger = logging.getLogger(__name__)
class WorkerProfileHandler(BaseHandler):
class BaseProfileHandler(BaseHandler):
"""Handles fetching and updating user profile information.
BaseProfileHandler can be instantiated directly on workers and will
delegate to master when necessary. The master process should use the
subclass MasterProfileHandler
"""
def __init__(self, hs):
super(WorkerProfileHandler, self).__init__(hs)
super(BaseProfileHandler, self).__init__(hs)
self.federation = hs.get_federation_client()
hs.get_federation_registry().register_query_handler(
@ -275,7 +282,7 @@ class WorkerProfileHandler(BaseHandler):
)
class MasterProfileHandler(WorkerProfileHandler):
class MasterProfileHandler(BaseProfileHandler):
PROFILE_UPDATE_MS = 60 * 1000
PROFILE_UPDATE_EVERY_MS = 24 * 60 * 60 * 1000

View File

@ -56,7 +56,7 @@ from synapse.handlers.initial_sync import InitialSyncHandler
from synapse.handlers.message import EventCreationHandler, MessageHandler
from synapse.handlers.pagination import PaginationHandler
from synapse.handlers.presence import PresenceHandler
from synapse.handlers.profile import MasterProfileHandler, WorkerProfileHandler
from synapse.handlers.profile import BaseProfileHandler, MasterProfileHandler
from synapse.handlers.read_marker import ReadMarkerHandler
from synapse.handlers.receipts import ReceiptsHandler
from synapse.handlers.room import RoomContextHandler, RoomCreationHandler
@ -309,7 +309,7 @@ class HomeServer(object):
def build_profile_handler(self):
if self.config.worker_app:
return WorkerProfileHandler(self)
return BaseProfileHandler(self)
else:
return MasterProfileHandler(self)