Skip to content

Commit

Permalink
Always return a deferred from get_current_state_deltas. (matrix-org…
Browse files Browse the repository at this point in the history
…#7019)

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 authored and phil-flex committed Mar 27, 2020
1 parent 3470d04 commit 198486c
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port `synapse.handlers.presence` to async/await.
4 changes: 3 additions & 1 deletion synapse/storage/data_stores/main/state_deltas.py
Original file line number Diff line number Diff line change
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 198486c

Please sign in to comment.