Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

worker: Allow long MissedMessageWorker consumes.

Alex Vandivera9688ceb7570
diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py
index 649b44da0b3..3849fc99456 100644
--- a/zerver/worker/queue_processors.py
+++ b/zerver/worker/queue_processors.py
@@ -561,6 +561,12 @@ class MissedMessageWorker(QueueProcessingWorker):
# of the consumer.
lock = Lock()
+ # Because the background `maybe_send_batched_email` thread can
+ # hold the lock for an indeterminate amount of time, the `consume`
+ # can block on that for longer than 30s, the default worker
+ # timeout. Allow arbitrarily-long worker `consume` calls.
+ MAX_CONSUME_SECONDS = None
+
def consume(self, event: Dict[str, Any]) -> None:
with self.lock:
logging.debug("Received missedmessage_emails event: %s", event)