From 48bab203bf15ad16b953f99b80b37ded1959f87b Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 12 Dec 2019 12:02:27 +0000 Subject: comma-separated cron schedule check should be first --- src/core_modules/cron.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/core_modules/cron.py') diff --git a/src/core_modules/cron.py b/src/core_modules/cron.py index 30aca2d7..d9793e02 100644 --- a/src/core_modules/cron.py +++ b/src/core_modules/cron.py @@ -30,16 +30,16 @@ class Module(ModuleManager.BaseModule): return True def _schedule_match_part(self, timestamp_part, schedule_part): - if schedule_part.startswith("*/"): - schedule_step = int(schedule_part.split("*/", 1)[1]) - if (timestamp_part%schedule_step) == 0: - return True - - elif "," in schedule_part: + if "," in schedule_part: for schedule_part in schedule_part.split(","): if self._match([timestamp_part], [schedule_part]): return True + elif schedule_part.startswith("*/"): + schedule_step = int(schedule_part.split("*/", 1)[1]) + if (timestamp_part%schedule_step) == 0: + return True + elif schedule_part == "*": return True -- cgit v1.3.1-10-gc9f91