From fa736f5a879d8be263a398605557322a314635d5 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 28 Feb 2013 19:26:36 +0100 Subject: [PATCH] daemon: Make shutting down a bit faster. First, send SIGTERM to all processes and then wait until they all have finished. --- python/pakfire/daemon.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/pakfire/daemon.py b/python/pakfire/daemon.py index 59800cfd..8c453e0c 100644 --- a/python/pakfire/daemon.py +++ b/python/pakfire/daemon.py @@ -144,15 +144,15 @@ class PakfireDaemon(object): """ Terminates all workers. """ + # First send SIGTERM to all processes. + self.terminate_worker(self.keepalive) for worker in self.workers: self.terminate_worker(worker) - # Wait until the worker has finished. - worker.join() - - # Terminate the keepalive process. - self.terminate_worker(self.keepalive) + # Then wait until they all have finished. self.keepalive.join() + for worker in self.workers: + worker.join() def remove_worker(self, worker): """ -- 2.39.2