This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
Allow profile updates to happen on workers #3659
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
495cb10
Allow profile changes to happen on workers
erikjohnston cd97658
Allow ratelimiting on workers
erikjohnston f81f421
Update workers.rst with new paths
erikjohnston 484a0eb
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/sp…
erikjohnston 54a9bea
Newsfile
erikjohnston a6c8137
Docstrings
erikjohnston 38f708a
Remote profile cache should remain in master worker
erikjohnston ca87ad1
Split ProfileHandler into master and worker
erikjohnston 782689b
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/sp…
erikjohnston 91cdb6d
Call UserDirectoryHandler methods directly
erikjohnston ab822a2
Add some fixmes
erikjohnston 47b25ba
Remove redundant vars
erikjohnston a81f140
Add assert to ensure handler is only run on master
erikjohnston 8432e2e
Rename WorkerProfileHandler to BaseProfileHandler
erikjohnston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Support profile API endpoints on workers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,8 +71,6 @@ def get_from_remote_profile_cache(self, user_id): | |
| desc="get_from_remote_profile_cache", | ||
| ) | ||
|
|
||
|
|
||
| class ProfileStore(ProfileWorkerStore): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there not a danger of races if the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on closer inspection, it looks like efforts are made to not call those methods from a worker, in which case I think they should probably stay in ProfileStore rather than moving.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Woops, fixed |
||
| def create_profile(self, user_localpart): | ||
| return self._simple_insert( | ||
| table="profiles", | ||
|
|
@@ -96,6 +94,8 @@ def set_profile_avatar_url(self, user_localpart, new_avatar_url): | |
| desc="set_profile_avatar_url", | ||
| ) | ||
|
|
||
|
|
||
| class ProfileStore(ProfileWorkerStore): | ||
| def add_remote_profile_cache(self, user_id, displayname, avatar_url): | ||
| """Ensure we are caching the remote user's profiles. | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we have this return
WorkerProfileHandlerand then override it insynapse.server.HomeServer? possibly with a comment here to say that's what's going on?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but this is how we do it for other handlers. I'm not sure I really think it'll be clearer moving it into the actual app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hrm, ok, let's punt it for now, though I'm not sure I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly something we can revisit if/when we try and clean up the worker split out