mirror of https://github.com/zulip/zulip.git
worker: Allow long MissedMessageWorker consumes.
This will stop dropping events in the case that the background `maybe_send_batched_email` thread takes longer than 30s. However, see also #15280 and the TODO comment about how we lose events upon restart; this worker is still lossy.
This commit is contained in:
parent
d5559e1e7b
commit
a9688ceb75
|
@ -561,6 +561,12 @@ class MissedMessageWorker(QueueProcessingWorker):
|
||||||
# of the consumer.
|
# of the consumer.
|
||||||
lock = Lock()
|
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:
|
def consume(self, event: Dict[str, Any]) -> None:
|
||||||
with self.lock:
|
with self.lock:
|
||||||
logging.debug("Received missedmessage_emails event: %s", event)
|
logging.debug("Received missedmessage_emails event: %s", event)
|
||||||
|
|
Loading…
Reference in New Issue