Terminate subprocesses right way on cronstop

This commit is contained in:
Oleg Blokhin
2014-05-22 16:46:06 +04:00
parent 87cf9307f0
commit 53e22fc31c
+4 -1
View File
@@ -260,7 +260,10 @@ class cronlauncher(threading.Thread):
shell=self.shell)
_cron_subprocs.append(proc)
(stdoutdata, stderrdata) = proc.communicate()
_cron_subprocs.remove(proc)
try:
_cron_subprocs.remove(proc)
except ValueError:
pass
if proc.returncode != 0:
logger.warning(
'WEB2PY CRON Call returned code %s:\n%s' %