Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
queue_processors: Defer initial email connection creation.
Alex Vandivere6a028427596
diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.pyindex c6a69957202..e6da895cffc 100644--- a/zerver/worker/queue_processors.py+++ b/zerver/worker/queue_processors.py@@ -790,7 +790,7 @@ class MissedMessageWorker(QueueProcessingWorker):class EmailSendingWorker(LoopQueueProcessingWorker):def __init__(self, threaded: bool = False, disable_timeout: bool = False) -> None:super().__init__(threaded, disable_timeout)- self.connection: BaseEmailBackend = initialize_connection(None)+ self.connection: Optional[BaseEmailBackend] = None@retry_send_email_failuresdef send_email(self, event: Dict[str, Any]) -> None:@@ -812,7 +812,8 @@ class EmailSendingWorker(LoopQueueProcessingWorker):@overridedef stop(self) -> None:try:- self.connection.close()+ if self.connection is not None:+ self.connection.close()finally:super().stop()