diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2022-04-22 18:20:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 18:20:06 +0100 |
commit | a50fb411b366576c3d4796b04c45385bdb7a6897 (patch) | |
tree | 1c41b7d0c634674f6a47e4edb8fc364c6c76b6fd /synapse/storage | |
parent | MSC3202: Fix device_unused_fallback_keys -> device_unused_fallback_key_types ... (diff) | |
download | synapse-a50fb411b366576c3d4796b04c45385bdb7a6897.tar.xz |
Update `delay_cancellation` to accept any awaitable (#12468)
This will mainly be useful when dealing with module callbacks, which are all typed as returning `Awaitable`s instead of coroutines or `Deferred`s. Signed-off-by: Sean Quah <seanq@element.io>
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/database.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py index 5eb545c86e..df1e9c1b83 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -41,7 +41,6 @@ from prometheus_client import Histogram from typing_extensions import Literal from twisted.enterprise import adbapi -from twisted.internet import defer from synapse.api.errors import StoreError from synapse.config.database import DatabaseConnectionConfig @@ -794,7 +793,7 @@ class DatabasePool: # We also wait until everything above is done before releasing the # `CancelledError`, so that logging contexts won't get used after they have been # finished. - return await delay_cancellation(defer.ensureDeferred(_runInteraction())) + return await delay_cancellation(_runInteraction()) async def runWithConnection( self, |