From 88cbaa1df92249cdfc1a19c76c4ee6c52fd1cddd Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 24 Nov 2011 16:21:52 +0100 Subject: [PATCH] Slight code reshuffle + added some comments on the construction. --- rq/worker.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rq/worker.py b/rq/worker.py index d266237..16b76d5 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -255,9 +255,13 @@ class Worker(object): os.waitpid(child_pid, 0) break except OSError as e: - if e.errno == errno.EINTR: - self.log.info('Not waiting for child.... received SIGINT.') - else: + # In case we encountered an OSError due to EINTR (which is + # caused by a SIGINT signal during os.waitpid()), we simply + # ignore it and enter the next iteration of the loop, + # waiting for the child to end. In any other case, this is + # some other unexpected OS error, which we don't want to + # catch, so we re-raise those ones. + if e.errno != errno.EINTR: raise def perform_job(self, job):