mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-27 09:58:41 +00:00
Remove Generator
in update_cached_last_access_time
(#17816)
Context: https://github.com/matrix-org/synapse/issues/15439 (https://github.com/element-hq/synapse/issues/15439) Also see discussion in https://github.com/element-hq/synapse/pull/17813
This commit is contained in:
parent
2e5fe3f187
commit
0c429fae1d
1
changelog.d/17816.bugfix
Normal file
1
changelog.d/17816.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Avoid lost data on some database query retries.
|
|
@ -729,10 +729,10 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
|
|||
|
||||
txn.execute_batch(
|
||||
sql,
|
||||
(
|
||||
[
|
||||
(time_ms, media_origin, media_id)
|
||||
for media_origin, media_id in remote_media
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
sql = (
|
||||
|
@ -740,7 +740,7 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
|
|||
" WHERE media_id = ?"
|
||||
)
|
||||
|
||||
txn.execute_batch(sql, ((time_ms, media_id) for media_id in local_media))
|
||||
txn.execute_batch(sql, [(time_ms, media_id) for media_id in local_media])
|
||||
|
||||
await self.db_pool.runInteraction(
|
||||
"update_cached_last_access_time", update_cache_txn
|
||||
|
|
Loading…
Reference in a new issue