added missing patch, thanks Niphlod
This commit is contained in:
1 parent
2be3037ed3
commit
78cc80714d
2 files changed
+25
-11
No files matched your search
@@ -1 +1 @@
|
|||||||
Version 2.0.9 (2012-09-21 09:37:29) stable
|
Version 2.0.9 (2012-09-21 22:01:45) stable
|
||||||
+24
-10
@@ -955,6 +955,19 @@ def check_existent_app(options,appname):
|
|||||||
if os.path.isdir(os.path.join(options.folder, 'applications', appname)):
|
if os.path.isdir(os.path.join(options.folder, 'applications', appname)):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def get_code_for_scheduler(app, options):
|
||||||
|
if len(app) == 1 or app[1] == None:
|
||||||
|
code = "from gluon import current;current._scheduler.loop()"
|
||||||
|
else:
|
||||||
|
code = "from gluon import current;current._scheduler.group_names = ['%s'];"
|
||||||
|
code += "current._scheduler.loop()"
|
||||||
|
code = code % ("','".join(app[1:]))
|
||||||
|
app_ = app[0]
|
||||||
|
if not check_existent_app(options, app_):
|
||||||
|
print "Application '%s' doesn't exist, skipping" % (app_)
|
||||||
|
return None, None
|
||||||
|
return app_, code
|
||||||
|
|
||||||
def start_schedulers(options):
|
def start_schedulers(options):
|
||||||
try:
|
try:
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
@@ -965,20 +978,21 @@ def start_schedulers(options):
|
|||||||
apps = [(app.strip(), None) for app in options.scheduler.split(',')]
|
apps = [(app.strip(), None) for app in options.scheduler.split(',')]
|
||||||
if options.scheduler_groups:
|
if options.scheduler_groups:
|
||||||
apps = options.scheduler_groups
|
apps = options.scheduler_groups
|
||||||
|
code = "from gluon import current;current._scheduler.loop()"
|
||||||
|
logging.getLogger().setLevel(options.debuglevel)
|
||||||
|
if len(apps) == 1:
|
||||||
|
app_, code = get_code_for_scheduler(apps[0], options)
|
||||||
|
if not app_:
|
||||||
|
return
|
||||||
|
print 'starting single-scheduler for "%s"...' % app_
|
||||||
|
run(app_,True,True,None,False,code)
|
||||||
|
return
|
||||||
for app in apps:
|
for app in apps:
|
||||||
if len(app) == 1 or app[1] == None:
|
app_, code = get_code_for_scheduler(app, options)
|
||||||
code = "from gluon import current;current._scheduler.loop()"
|
if not app_:
|
||||||
else:
|
|
||||||
code = "from gluon import current;current._scheduler.group_names = ['%s'];"
|
|
||||||
code += "current._scheduler.loop()"
|
|
||||||
code = code % ("','".join(app[1:]))
|
|
||||||
app_ = app[0]
|
|
||||||
if not check_existent_app(options, app_):
|
|
||||||
print "Application '%s' doesn't exist, skipping" % (app_)
|
|
||||||
continue
|
continue
|
||||||
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)
|
||||||
logging.getLogger().setLevel(options.debuglevel)
|
|
||||||
p = Process(target=run, args=args)
|
p = Process(target=run, args=args)
|
||||||
processes.append(p)
|
processes.append(p)
|
||||||
print "Currently running %s scheduler processes" % (len(processes))
|
print "Currently running %s scheduler processes" % (len(processes))
|
||||||
|
|||||||
Reference in new issue
Block a user