forked from MirrorHub/synapse
Fix use of async/await in media code (#7184)
This commit is contained in:
parent
62a7289133
commit
0a7b0882c1
2 changed files with 3 additions and 2 deletions
1
changelog.d/7184.misc
Normal file
1
changelog.d/7184.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Convert some of synapse.rest.media to async/await.
|
|
@ -340,7 +340,7 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
|
||||||
"get_expired_url_cache", _get_expired_url_cache_txn
|
"get_expired_url_cache", _get_expired_url_cache_txn
|
||||||
)
|
)
|
||||||
|
|
||||||
def delete_url_cache(self, media_ids):
|
async def delete_url_cache(self, media_ids):
|
||||||
if len(media_ids) == 0:
|
if len(media_ids) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
|
||||||
def _delete_url_cache_txn(txn):
|
def _delete_url_cache_txn(txn):
|
||||||
txn.executemany(sql, [(media_id,) for media_id in media_ids])
|
txn.executemany(sql, [(media_id,) for media_id in media_ids])
|
||||||
|
|
||||||
return self.db.runInteraction("delete_url_cache", _delete_url_cache_txn)
|
return await self.db.runInteraction("delete_url_cache", _delete_url_cache_txn)
|
||||||
|
|
||||||
def get_url_cache_media_before(self, before_ts):
|
def get_url_cache_media_before(self, before_ts):
|
||||||
sql = (
|
sql = (
|
||||||
|
|
Loading…
Reference in a new issue