ctrl+C now kills scheduler too, issue 126, thanks Niphlod
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.0 (2012-06-25 14:14:39) dev
|
Version 2.00.0 (2012-06-25 14:18:18) dev
|
||||||
|
|||||||
+5
-2
@@ -846,7 +846,7 @@ def start_schedulers(options):
|
|||||||
sys.stderr.write('Sorry, -K only supported for python 2.6-2.7\n')
|
sys.stderr.write('Sorry, -K only supported for python 2.6-2.7\n')
|
||||||
return
|
return
|
||||||
processes = []
|
processes = []
|
||||||
code = "from gluon import current; current._scheduler.loop()"
|
code = "from gluon import current;current._scheduler.loop()"
|
||||||
for app in apps:
|
for app in apps:
|
||||||
print 'starting scheduler for "%s"...' % app
|
print 'starting scheduler for "%s"...' % app
|
||||||
args = (app,True,True,None,False,code)
|
args = (app,True,True,None,False,code)
|
||||||
@@ -859,7 +859,10 @@ def start_schedulers(options):
|
|||||||
for p in processes:
|
for p in processes:
|
||||||
try:
|
try:
|
||||||
p.join()
|
p.join()
|
||||||
except KeyboardInterrupt:
|
except (KeyboardInterrupt, SystemExit):
|
||||||
|
print "Processes stopped"
|
||||||
|
raise
|
||||||
|
except:
|
||||||
p.terminate()
|
p.terminate()
|
||||||
p.join()
|
p.join()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user