From 9aa15db007f0604c47beeeb8d149bd7ef2f03dde Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 25 Jun 2012 14:18:20 -0500 Subject: [PATCH] ctrl+C now kills scheduler too, issue 126, thanks Niphlod --- VERSION | 2 +- gluon/widget.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 73152e83..514d9bc3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-06-25 14:14:39) dev +Version 2.00.0 (2012-06-25 14:18:18) dev diff --git a/gluon/widget.py b/gluon/widget.py index 185a1af6..1e6391c5 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -846,7 +846,7 @@ def start_schedulers(options): sys.stderr.write('Sorry, -K only supported for python 2.6-2.7\n') return processes = [] - code = "from gluon import current; current._scheduler.loop()" + code = "from gluon import current;current._scheduler.loop()" for app in apps: print 'starting scheduler for "%s"...' % app args = (app,True,True,None,False,code) @@ -859,10 +859,13 @@ def start_schedulers(options): for p in processes: try: p.join() - except KeyboardInterrupt: + except (KeyboardInterrupt, SystemExit): + print "Processes stopped" + raise + except: p.terminate() p.join() - + def start(cron=True): """ Start server """