Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# Register signal handlers
self.register_signal_handlers()
+ # Run everything from here asynchronously
+ asyncio.run(self._work())
+
+ self.log.debug("Worker %s terminated gracefully" % self.pid)
+
+ async def _work(self):
+ """
+ Called from the async IO loop doing all the work
+ """
# Extract the job id
job_id = self.data.get("id")
if not job_id:
import time
time.sleep(10)
- self.log.debug("Worker %s terminated gracefully" % self.pid)
-
def shutdown(self):
self.__running = False