From bcb47909c9bc23b623a8061c7f4ea87e223b9ad2 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 27 Sep 2019 15:00:00 +0200 Subject: [PATCH] Reverted seconds support in cronjobs --- platypush/cron/scheduler.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/platypush/cron/scheduler.py b/platypush/cron/scheduler.py index 9fd40b9ed..5b67b7da7 100644 --- a/platypush/cron/scheduler.py +++ b/platypush/cron/scheduler.py @@ -28,12 +28,9 @@ class Cronjob(Thread): def should_run(self): - cron_units = re.split('\s+', self.cron_expression) - units = ('second', 'minute', 'hour', 'day', 'month', 'year') \ - if len(cron_units) > 5 else \ - ('minute', 'hour', 'day', 'month', 'year') - + units = ('minute', 'hour', 'day', 'month', 'year') now = datetime.datetime.fromtimestamp(time.time()) + cron_units = re.split('\s+', self.cron_expression) for i in range(0, len(units)): unit = units[i] @@ -81,7 +78,7 @@ class CronScheduler(Thread): if job.should_run(): job.start() - time.sleep(0.5) + time.sleep(60) # vim:sw=4:ts=4:et: