Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Port PresenceHandler to async/await (#6991)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Feb 26, 2020
1 parent 7728d87 commit 1f773ee
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 115 deletions.
1 change: 1 addition & 0 deletions changelog.d/6991.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port `synapse.handlers.presence` to async/await.
5 changes: 2 additions & 3 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,11 +1016,10 @@ def _notify():
# matters as sometimes presence code can take a while.
run_in_background(self._bump_active_time, requester.user)

@defer.inlineCallbacks
def _bump_active_time(self, user):
async def _bump_active_time(self, user):
try:
presence = self.hs.get_presence_handler()
yield presence.bump_presence_active_time(user)
await presence.bump_presence_active_time(user)
except Exception:
logger.exception("Error bumping presence active time")

Expand Down
Loading

0 comments on commit 1f773ee

Please sign in to comment.