diff --git a/VERSION b/VERSION index 2926f1ed..6cdf8a79 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.2-stable+timestamp.2013.03.10.09.09.48 +Version 2.4.2-stable+timestamp.2013.03.10.10.20.58 diff --git a/gluon/newcron.py b/gluon/newcron.py index aa3bcd9f..bc8fb438 100644 --- a/gluon/newcron.py +++ b/gluon/newcron.py @@ -22,6 +22,7 @@ from settings import global_settings logger = logging.getLogger("web2py.cron") _cron_stopping = False +_cron_subprocs = [] def absolute_path_link(path): @@ -42,7 +43,8 @@ def stopcron(): "graceful shutdown of cron" global _cron_stopping _cron_stopping = True - + while _cron_subprocs: + _cron_subprocs.pop().terminate() class extcron(threading.Thread): @@ -232,6 +234,7 @@ class cronlauncher(threading.Thread): def run(self): import subprocess + global _cron_subprocs if isinstance(self.cmd, (list, tuple)): cmd = self.cmd else: @@ -241,6 +244,7 @@ class cronlauncher(threading.Thread): stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=self.shell) + _cron_subprocs.append(proc) (stdoutdata, stderrdata) = proc.communicate() if proc.returncode != 0: logger.warning( diff --git a/gluon/widget.py b/gluon/widget.py index 1e31624b..d4ed169d 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -434,6 +434,10 @@ class web2pyDialog(object): self.try_stop_scheduler(t) except: pass + try: + newcron.stopcron() + except: + pass try: self.server.stop() except: