diff options
author | Erik Johnston <erik@matrix.org> | 2018-02-27 12:01:36 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-02-27 13:58:16 +0000 |
commit | 493e25d5545389264f696be0e07544bf82a0818a (patch) | |
tree | 15b19197bf78f9f0382bb901cfea771712fc176f /synapse/storage/roommember.py | |
parent | Merge pull request #2904 from matrix-org/erikj/receipt_cache_invalidation (diff) | |
download | synapse-493e25d5545389264f696be0e07544bf82a0818a.tar.xz |
Move storage functions for push calculations
This will allow push actions for an event to be calculated on workers.
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r-- | synapse/storage/roommember.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index b9158b9896..d79877dac7 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -432,6 +432,18 @@ class RoomMemberWorkerStore(EventsWorkerStore): def _get_joined_hosts_cache(self, room_id): return _JoinedHostsCache(self, room_id) + @cached() + def who_forgot_in_room(self, room_id): + return self._simple_select_list( + table="room_memberships", + retcols=("user_id", "event_id"), + keyvalues={ + "room_id": room_id, + "forgotten": 1, + }, + desc="who_forgot" + ) + class RoomMemberStore(RoomMemberWorkerStore): def __init__(self, db_conn, hs): @@ -595,18 +607,6 @@ class RoomMemberStore(RoomMemberWorkerStore): forgot = yield self.runInteraction("did_forget_membership_at", f) defer.returnValue(forgot == 1) - @cached() - def who_forgot_in_room(self, room_id): - return self._simple_select_list( - table="room_memberships", - retcols=("user_id", "event_id"), - keyvalues={ - "room_id": room_id, - "forgotten": 1, - }, - desc="who_forgot" - ) - @defer.inlineCallbacks def _background_add_membership_profile(self, progress, batch_size): target_min_stream_id = progress.get( |