mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 01:00:54 +00:00
Merge pull request #2637 from spantaleev/avoid-noop-media-deletes
Avoid no-op media deletes
This commit is contained in:
commit
167eb01d83
1 changed files with 6 additions and 0 deletions
|
@ -254,6 +254,9 @@ class MediaRepositoryStore(SQLBaseStore):
|
||||||
return self.runInteraction("get_expired_url_cache", _get_expired_url_cache_txn)
|
return self.runInteraction("get_expired_url_cache", _get_expired_url_cache_txn)
|
||||||
|
|
||||||
def delete_url_cache(self, media_ids):
|
def delete_url_cache(self, media_ids):
|
||||||
|
if len(media_ids) == 0:
|
||||||
|
return
|
||||||
|
|
||||||
sql = (
|
sql = (
|
||||||
"DELETE FROM local_media_repository_url_cache"
|
"DELETE FROM local_media_repository_url_cache"
|
||||||
" WHERE media_id = ?"
|
" WHERE media_id = ?"
|
||||||
|
@ -281,6 +284,9 @@ class MediaRepositoryStore(SQLBaseStore):
|
||||||
)
|
)
|
||||||
|
|
||||||
def delete_url_cache_media(self, media_ids):
|
def delete_url_cache_media(self, media_ids):
|
||||||
|
if len(media_ids) == 0:
|
||||||
|
return
|
||||||
|
|
||||||
def _delete_url_cache_media_txn(txn):
|
def _delete_url_cache_media_txn(txn):
|
||||||
sql = (
|
sql = (
|
||||||
"DELETE FROM local_media_repository"
|
"DELETE FROM local_media_repository"
|
||||||
|
|
Loading…
Reference in a new issue