don't kill ourself on reload

Killing ourself when using the `--reload` option trigger an infinite loop under some monitoring services like the one in pycharm and don't reload the file.

Instead set self.alive as False which will trigger later the worker exit. Note that if we want to force the exit we could also use sys.exit(0) .

fix #1129
This commit is contained in:
benoitc 2016-05-13 11:09:14 +02:00
parent 8e8611a741
commit 3cbbc713b1

View File

@ -89,7 +89,7 @@ class Worker(object):
if self.cfg.reload:
def changed(fname):
self.log.info("Worker reloading: %s modified", fname)
os.kill(self.pid, signal.SIGQUIT)
self.alive = False
self.reloader = Reloader(callback=changed)
self.reloader.start()