Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
fdca6e36
Commit
fdca6e36
authored
7 years ago
by
Erik Johnston
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2274 from matrix-org/erikj/cache_is_host_joined
Add cache for is_host_joined
parents
90ae0cff
d53fe399
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/replication/slave/storage/events.py
+1
-1
1 addition, 1 deletion
synapse/replication/slave/storage/events.py
synapse/storage/events.py
+5
-0
5 additions, 0 deletions
synapse/storage/events.py
synapse/storage/roommember.py
+1
-1
1 addition, 1 deletion
synapse/storage/roommember.py
with
7 additions
and
2 deletions
synapse/replication/slave/storage/events.py
+
1
−
1
View file @
fdca6e36
...
...
@@ -153,7 +153,7 @@ class SlavedEventStore(BaseSlavedStore):
get_room_events_stream_for_rooms
=
(
DataStore
.
get_room_events_stream_for_rooms
.
__func__
)
is_host_joined
=
DataStore
.
is_host_joined
.
__func__
is_host_joined
=
RoomMemberStore
.
__dict__
[
"
is_host_joined
"
]
get_stream_token_for_event
=
DataStore
.
get_stream_token_for_event
.
__func__
_set_before_and_after
=
staticmethod
(
DataStore
.
_set_before_and_after
)
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/events.py
+
5
−
0
View file @
fdca6e36
...
...
@@ -776,6 +776,11 @@ class EventsStore(SQLBaseStore):
txn
,
self
.
get_rooms_for_user
,
(
member
,)
)
for
host
in
set
(
get_domain_from_id
(
u
)
for
u
in
members_changed
):
self
.
_invalidate_cache_and_stream
(
txn
,
self
.
is_host_joined
,
(
room_id
,
host
)
)
self
.
_invalidate_cache_and_stream
(
txn
,
self
.
get_users_in_room
,
(
room_id
,)
)
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/roommember.py
+
1
−
1
View file @
fdca6e36
...
...
@@ -501,7 +501,7 @@ class RoomMemberStore(SQLBaseStore):
defer
.
returnValue
(
users_in_room
)
@
defer.i
nlineCallbacks
@
cachedI
nlineCallbacks
(
max_entries
=
10000
)
def
is_host_joined
(
self
,
room_id
,
host
):
if
'
%
'
in
host
or
'
_
'
in
host
:
raise
Exception
(
"
Invalid host name
"
)
...
...
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