]> git.ipfire.org Git - pakfire.git/commitdiff
daemon: Catch any timeout errors in the log streamer
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Nov 2022 21:49:52 +0000 (21:49 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Nov 2022 21:49:52 +0000 (21:49 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/daemon.py

index 166f28e78539bf3e81ab9bb0d6886931ec83fbac..202ee84d64093417b7d72b97d00f64ced091b4d1 100644 (file)
@@ -381,7 +381,15 @@ class BuildLogger(object):
 
                while True:
                        # Fetch a message from the queue
-                       message = await asyncio.wait_for(self.queue.get(), timeout=timeout)
+                       try:
+                               message = await asyncio.wait_for(self.queue.get(), timeout=timeout)
+
+                       # If we did not receive any messages within the timeout,
+                       # we return control back to the caller
+                       except asyncio.TimeoutError as e:
+                               break
+
+                       # Ignore any empty messages
                        if message is None:
                                continue