From 3cbce0c5c7d08bc91a60a0f11ec727d13f28d236 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 15 Feb 2024 15:39:50 +0000 Subject: [PATCH] missedmessage_emails: Clear caches and db query tracking per-loop. Otherwise, these accumulate and leak memory. --- zerver/worker/queue_processors.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index fad210b6b6..8e48b51a93 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -689,6 +689,8 @@ class MissedMessageWorker(QueueProcessingWorker): def work(self) -> None: while True: + flush_per_request_caches() + reset_queries() try: finished = self.background_loop() if finished: