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

Commit

Permalink
Always return a deferred from get_current_state_deltas. (#7019)
Browse files Browse the repository at this point in the history
This currently causes presence notify code to log exceptions when there
is no state changes to process. This doesn't actually cause any problems
as we'd simply do nothing anyway.
  • Loading branch information
erikjohnston committed Mar 2, 2020
1 parent 3ab8e9c commit b29474e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/7019.misc
@@ -0,0 +1 @@
Port `synapse.handlers.presence` to async/await.
4 changes: 3 additions & 1 deletion synapse/storage/data_stores/main/state_deltas.py
Expand Up @@ -15,6 +15,8 @@

import logging

from twisted.internet import defer

from synapse.storage._base import SQLBaseStore

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -56,7 +58,7 @@ def get_current_state_deltas(self, prev_stream_id: int, max_stream_id: int):
# if the CSDs haven't changed between prev_stream_id and now, we
# know for certain that they haven't changed between prev_stream_id and
# max_stream_id.
return max_stream_id, []
return defer.succeed((max_stream_id, []))

def get_current_state_deltas_txn(txn):
# First we calculate the max stream id that will give us less than
Expand Down

0 comments on commit b29474e

Please sign in to comment.