forked from platypush/platypush
Reverted seconds support in cronjobs
This commit is contained in:
parent
87d14134f8
commit
bcb47909c9
1 changed files with 3 additions and 6 deletions
|
@ -28,12 +28,9 @@ class Cronjob(Thread):
|
||||||
|
|
||||||
|
|
||||||
def should_run(self):
|
def should_run(self):
|
||||||
cron_units = re.split('\s+', self.cron_expression)
|
units = ('minute', 'hour', 'day', 'month', 'year')
|
||||||
units = ('second', 'minute', 'hour', 'day', 'month', 'year') \
|
|
||||||
if len(cron_units) > 5 else \
|
|
||||||
('minute', 'hour', 'day', 'month', 'year')
|
|
||||||
|
|
||||||
now = datetime.datetime.fromtimestamp(time.time())
|
now = datetime.datetime.fromtimestamp(time.time())
|
||||||
|
cron_units = re.split('\s+', self.cron_expression)
|
||||||
|
|
||||||
for i in range(0, len(units)):
|
for i in range(0, len(units)):
|
||||||
unit = units[i]
|
unit = units[i]
|
||||||
|
@ -81,7 +78,7 @@ class CronScheduler(Thread):
|
||||||
if job.should_run():
|
if job.should_run():
|
||||||
job.start()
|
job.start()
|
||||||
|
|
||||||
time.sleep(0.5)
|
time.sleep(60)
|
||||||
|
|
||||||
|
|
||||||
# vim:sw=4:ts=4:et:
|
# vim:sw=4:ts=4:et:
|
||||||
|
|
Loading…
Reference in a new issue