mirror of https://github.com/rq/rq.git
Silently pass when trying to kill child that is already dead.
This fixes #16.
This commit is contained in:
parent
039a132374
commit
5c6f002878
|
@ -195,7 +195,13 @@ class Worker(object):
|
||||||
# Take down the horse with the worker
|
# Take down the horse with the worker
|
||||||
if self.horse_pid:
|
if self.horse_pid:
|
||||||
self.log.debug('Taking down horse %d with me.' % self.horse_pid)
|
self.log.debug('Taking down horse %d with me.' % self.horse_pid)
|
||||||
|
try:
|
||||||
os.kill(self.horse_pid, signal.SIGKILL)
|
os.kill(self.horse_pid, signal.SIGKILL)
|
||||||
|
except OSError as e:
|
||||||
|
# ESRCH ("No such process") is fine with us
|
||||||
|
if e.errno != errno.ESRCH:
|
||||||
|
self.log.debug('Horse already down.')
|
||||||
|
raise
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
|
|
||||||
def request_stop(signum, frame):
|
def request_stop(signum, frame):
|
||||||
|
|
Loading…
Reference in New Issue