diff options
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/roommember.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index ba1afafaa5..039188a3be 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -66,6 +66,7 @@ class RoomMemberWorkerStore(EventsWorkerStore): defer.returnValue(hosts) @cached(max_entries=100000, iterable=True) + @defer.inlineCallbacks def get_users_in_room(self, room_id): def f(txn): sql = ( @@ -79,7 +80,14 @@ class RoomMemberWorkerStore(EventsWorkerStore): txn.execute(sql, (room_id, Membership.JOIN,)) return [to_ascii(r[0]) for r in txn] - return self.runInteraction("get_users_in_room", f) + start_time = self._clock.time_msec() + result = yield self.runInteraction("get_users_in_room", f) + end_time = self._clock.time_msec() + logger.info( + "Fetched room membership for %s (%i users) in %i ms", + room_id, len(result), end_time - start_time, + ) + defer.returnValue(result) @cached() def get_invited_rooms_for_user(self, user_id): |