From: Michael Tremer Date: Sun, 23 Oct 2022 19:22:37 +0000 (+0000) Subject: hub: Try to dispatch any jobs once a builder connects X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a4c7ef87476b30635c59f0c68e93e8a443318ed;p=pbs.git hub: Try to dispatch any jobs once a builder connects Signed-off-by: Michael Tremer --- diff --git a/src/hub/queue.py b/src/hub/queue.py index 6873e490..11879c4f 100644 --- a/src/hub/queue.py +++ b/src/hub/queue.py @@ -85,7 +85,7 @@ class QueueHandler(BackendMixin, tornado.websocket.WebSocketHandler): return self.current_user @tornado.web.authenticated - def open(self): + async def open(self): logging.debug("Connection opened by %s" % self.builder) # Find any previous connections of this builder and close them @@ -102,6 +102,9 @@ class QueueHandler(BackendMixin, tornado.websocket.WebSocketHandler): # Add this connection to the list connections.append(self) + # Dispatch any jobs immediately + await dispatch_jobs(self.backend) + def on_close(self): logging.debug("Connection to %s closed" % self.builder)