summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-08-03 16:22:25 -0700
committerAndrew Morgan <andrew@amorgan.xyz>2020-08-03 16:22:25 -0700
commit5c4e0e62bc35f12ee8dbc632a4947338cae00bff (patch)
tree24552011e5c3cc58be5b1d3cb608d2f8fea0967f /synapse/storage
parentMerge commit '5c5516f80' into dinsic (diff)
parentFix "argument of type 'ObservableDeferred' is not iterable" error (#7708) (diff)
downloadsynapse-5c4e0e62bc35f12ee8dbc632a4947338cae00bff.tar.xz
Merge commit '231252516' into dinsic
* commit '231252516':
  Fix "argument of type 'ObservableDeferred' is not iterable" error (#7708)
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/data_stores/main/receipts.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/storage/data_stores/main/receipts.py b/synapse/storage/data_stores/main/receipts.py
index cebdcd409f..d4a7163049 100644
--- a/synapse/storage/data_stores/main/receipts.py
+++ b/synapse/storage/data_stores/main/receipts.py
@@ -24,6 +24,7 @@ from twisted.internet import defer
 from synapse.storage._base import SQLBaseStore, make_in_list_sql_clause
 from synapse.storage.database import Database
 from synapse.storage.util.id_generators import StreamIdGenerator
+from synapse.util.async_helpers import ObservableDeferred
 from synapse.util.caches.descriptors import cached, cachedInlineCallbacks, cachedList
 from synapse.util.caches.stream_change_cache import StreamChangeCache
 
@@ -300,10 +301,10 @@ class ReceiptsWorkerStore(SQLBaseStore):
             room_id, None, update_metrics=False
         )
 
-        # first handle the Deferred case
-        if isinstance(res, defer.Deferred):
-            if res.called:
-                res = res.result
+        # first handle the ObservableDeferred case
+        if isinstance(res, ObservableDeferred):
+            if res.has_called():
+                res = res.get_result()
             else:
                 res = None