diff options
author | Erik Johnston <erik@matrix.org> | 2020-03-02 16:52:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 16:52:15 +0000 |
commit | b29474e0aa866a50ec96cd921cc5025fc9718e73 (patch) | |
tree | 1b74864c5488d43949a03d05edb222c32e39cf9c | |
parent | Fix py35-old CI by using native tox. (#7018) (diff) | |
download | synapse-b29474e0aa866a50ec96cd921cc5025fc9718e73.tar.xz |
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.
-rw-r--r-- | changelog.d/7019.misc | 1 | ||||
-rw-r--r-- | synapse/storage/data_stores/main/state_deltas.py | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/changelog.d/7019.misc b/changelog.d/7019.misc new file mode 100644 index 0000000000..5130f4e8af --- /dev/null +++ b/changelog.d/7019.misc @@ -0,0 +1 @@ +Port `synapse.handlers.presence` to async/await. diff --git a/synapse/storage/data_stores/main/state_deltas.py b/synapse/storage/data_stores/main/state_deltas.py index 12c982cb26..725e12507f 100644 --- a/synapse/storage/data_stores/main/state_deltas.py +++ b/synapse/storage/data_stores/main/state_deltas.py @@ -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 |