This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add secondary_directory_servers option to fetch room list from other servers #808
Merged
Conversation
This file contains 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
…explaining it's not a permanent solution
Poll for updates from remote servers, waiting for the poll if there's no cache entry.
Otherwise it tries to start the remote public room list updating looping call which breaks.
# tag all the ones in our list with our server name. | ||
# Also add the them to the de-deping set | ||
for room in public_rooms['chunk']: | ||
room["server_name"] = self.hs.hostname |
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.
Is this actually necessary or is it, by definition, the domain part of the published alias?
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.
Not all published rooms will have aliases, and even those that do may have aliases from servers other than the server (e.g., you can have a single room being published to multiple lists)
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.
Oh, of course :)
LGTM |
1 similar comment
LGTM |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This polls the list of remote servers for their lists every minute, returning the cached results from the last successful fetch (since server restart). If there is no cached result, it will wait for any currently running poll to complete before returning the result.
We probably want an additional cache somewhere to reduce the load from producing the local room list, which I suspect will be a cache of the whole aggregated room list. If so, this probably belongs in a separate PR.