Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
8432e2eb
Commit
8432e2eb
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Rename WorkerProfileHandler to BaseProfileHandler
parent
a81f1408
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/handlers/profile.py
+10
-3
10 additions, 3 deletions
synapse/handlers/profile.py
synapse/server.py
+2
-2
2 additions, 2 deletions
synapse/server.py
with
12 additions
and
5 deletions
synapse/handlers/profile.py
+
10
−
3
View file @
8432e2eb
...
...
@@ -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
(
Worker
ProfileHandler
,
self
).
__init__
(
hs
)
super
(
Base
ProfileHandler
,
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
(
Worker
ProfileHandler
):
class
MasterProfileHandler
(
Base
ProfileHandler
):
PROFILE_UPDATE_MS
=
60
*
1000
PROFILE_UPDATE_EVERY_MS
=
24
*
60
*
60
*
1000
...
...
This diff is collapsed.
Click to expand it.
synapse/server.py
+
2
−
2
View file @
8432e2eb
...
...
@@ -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
M
as
ter
ProfileHandler
,
Work
erProfileHandler
from
synapse.handlers.profile
import
B
as
e
ProfileHandler
,
Mast
erProfileHandler
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
Worker
ProfileHandler
(
self
)
return
Base
ProfileHandler
(
self
)
else
:
return
MasterProfileHandler
(
self
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment