Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
queue_processors: Fix UnboundLocalError in QueueProcessingWorker.
Mateusz Manderaa7039c815e33
diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.pyindex 0b06303ab90..bcc99f8e823 100644--- a/zerver/worker/queue_processors.py+++ b/zerver/worker/queue_processors.py@@ -212,14 +212,14 @@ class QueueProcessingWorker(ABC):def do_consume(self, consume_func: Callable[[List[Dict[str, Any]]], None],events: List[Dict[str, Any]]) -> None:+ consume_time_seconds: Optional[float] = Nonetry:time_start = time.time()consume_func(events)- consume_time_seconds: Optional[float] = time.time() - time_start+ consume_time_seconds = time.time() - time_startself.consumed_since_last_emptied += len(events)except Exception:self._handle_consume_exception(events)- consume_time_seconds = Nonefinally:flush_per_request_caches()reset_queries()