From: Michael Tremer Date: Thu, 3 Nov 2022 21:49:52 +0000 (+0000) Subject: daemon: Catch any timeout errors in the log streamer X-Git-Tag: 0.9.28~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d97c00f7e93b80c49ecfa7c43c5e2f2020e652d;p=pakfire.git daemon: Catch any timeout errors in the log streamer Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/daemon.py b/src/pakfire/daemon.py index 166f28e78..202ee84d6 100644 --- a/src/pakfire/daemon.py +++ b/src/pakfire/daemon.py @@ -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