summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erikj@matrix.org>2023-08-23 13:04:46 +0100
committerGitHub <noreply@github.com>2023-08-23 13:04:46 +0100
commit86ecd341ec93167fbb5a335237c1cd629e7256a2 (patch)
treedfd302d1e79f9a59b47501d5a959f3410aaeacdb /synapse/storage
parentTask scheduler: mark task as active if we are scheduling ASAP (#16165) (diff)
downloadsynapse-86ecd341ec93167fbb5a335237c1cd629e7256a2.tar.xz
Always update `retry_last_ts` (#16164)
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/databases/main/transactions.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/databases/main/transactions.py b/synapse/storage/databases/main/transactions.py
index 48e4b0ba3c..860bbf7c0f 100644
--- a/synapse/storage/databases/main/transactions.py
+++ b/synapse/storage/databases/main/transactions.py
@@ -242,8 +242,6 @@ class TransactionWorkerStore(CacheInvalidationWorkerStore):
     ) -> None:
         # Upsert retry time interval if retry_interval is zero (i.e. we're
         # resetting it) or greater than the existing retry interval.
-        # We also upsert when the new retry interval is the same as the existing one,
-        # since it will be the case when `destination_max_retry_interval` is reached.
         #
         # WARNING: This is executed in autocommit, so we shouldn't add any more
         # SQL calls in here (without being very careful).
@@ -258,8 +256,10 @@ class TransactionWorkerStore(CacheInvalidationWorkerStore):
                     retry_interval = EXCLUDED.retry_interval
                 WHERE
                     EXCLUDED.retry_interval = 0
+                    OR EXCLUDED.retry_last_ts = 0
                     OR destinations.retry_interval IS NULL
-                    OR destinations.retry_interval <= EXCLUDED.retry_interval
+                    OR destinations.retry_interval < EXCLUDED.retry_interval
+                    OR destinations.retry_last_ts < EXCLUDED.retry_last_ts
         """
 
         txn.execute(sql, (destination, failure_ts, retry_last_ts, retry_interval))