0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-15 22:42:23 +01:00

Always return a deferred from get_current_state_deltas. (#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.
This commit is contained in:
Erik Johnston 2020-03-02 16:52:15 +00:00 committed by GitHub
parent 3ab8e9c293
commit b29474e0aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

1
changelog.d/7019.misc Normal file
View file

@ -0,0 +1 @@
Port `synapse.handlers.presence` to async/await.

View file

@ -15,6 +15,8 @@
import logging
from twisted.internet import defer
from synapse.storage._base import SQLBaseStore
logger = logging.getLogger(__name__)
@ -56,7 +58,7 @@ class StateDeltasStore(SQLBaseStore):
# 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