cron disabled by default unless -H

This commit is contained in:
mdipierro
2012-10-14 18:29:17 -05:00
parent df7d6847e6
commit d5749db0cd
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.1.0 (2012-10-14 16:40:34) dev Version 2.1.0 (2012-10-14 18:29:10) dev
+7 -7
View File
@@ -804,10 +804,10 @@ def console():
default=False, default=False,
help=msg) help=msg)
parser.add_option('-N', parser.add_option('-H',
'--no-cron', '--run-cron',
action='store_true', action='store_true',
dest='nocron', dest='runcron',
default=False, default=False,
help='do not start cron automatically') help='do not start cron automatically')
@@ -904,7 +904,7 @@ def console():
if options.cronjob: if options.cronjob:
global_settings.cronjob = True # tell the world global_settings.cronjob = True # tell the world
options.nocron = True # don't start cron jobs options.run = False # don't start cron jobs
options.plain = True # cronjobs use a plain shell options.plain = True # cronjobs use a plain shell
options.nobanner = True options.nobanner = True
options.nogui = True options.nogui = True
@@ -1083,13 +1083,13 @@ def start(cron=True):
return return
# ## if -N or not cron disable cron in this *process* # ## if -H cron is enabled in this *process*
# ## if --softcron use softcron # ## if --softcron use softcron
# ## use hardcron in all other cases # ## use hardcron in all other cases
if cron and not options.nocron and options.softcron: if cron and options.runcron and options.softcron:
print 'Using softcron (but this is not very efficient)' print 'Using softcron (but this is not very efficient)'
global_settings.web2py_crontype = 'soft' global_settings.web2py_crontype = 'soft'
elif cron and not options.nocron: elif cron and options.runcron:
logger.debug('Starting hardcron...') logger.debug('Starting hardcron...')
global_settings.web2py_crontype = 'hard' global_settings.web2py_crontype = 'hard'
newcron.hardcron(options.folder).start() newcron.hardcron(options.folder).start()