Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 1d86a9a

Browse files
committed
Move retention purge_jobs running to the main worker
1 parent 9c68d71 commit 1d86a9a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

synapse/handlers/pagination.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,9 @@ def __init__(self, hs: "HomeServer"):
163163
self._retention_allowed_lifetime_max = (
164164
hs.config.retention.retention_allowed_lifetime_max
165165
)
166+
self._is_master = hs.config.worker.worker_app is None
166167

167-
if (
168-
hs.config.worker.run_background_tasks
169-
and hs.config.retention.retention_enabled
170-
):
168+
if hs.config.retention.retention_enabled and self._is_master:
171169
# Run the purge jobs described in the configuration file.
172170
for job in hs.config.retention.retention_purge_jobs:
173171
logger.info("Setting up purge job with config: %s", job)

0 commit comments

Comments
 (0)