We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96ed87a commit ea6b3caCopy full SHA for ea6b3ca
synapse/storage/databases/main/delayed_events.py
@@ -307,7 +307,8 @@ def _prune_excess_finalised_delayed_events_for_user(
307
keyvalues={"user_localpart": user_localpart},
308
retcol="COUNT(*)",
309
)
310
- if num_existing > retention_limit:
+ num_excess = num_existing - retention_limit
311
+ if num_existing > 0:
312
txn.execute(
313
"""
314
DELETE FROM delayed_events
@@ -321,7 +322,7 @@ def _prune_excess_finalised_delayed_events_for_user(
321
322
""",
323
(
324
user_localpart,
- num_existing - retention_limit,
325
+ num_existing - num_existing,
326
),
327
328
0 commit comments