comma-separated cron schedule check should be first

This commit is contained in:
jesopo 2019-12-12 12:02:27 +00:00
parent 13f2baf303
commit 48bab203bf

View file

@ -30,16 +30,16 @@ class Module(ModuleManager.BaseModule):
return True return True
def _schedule_match_part(self, timestamp_part, schedule_part): def _schedule_match_part(self, timestamp_part, schedule_part):
if schedule_part.startswith("*/"): if "," in schedule_part:
schedule_step = int(schedule_part.split("*/", 1)[1])
if (timestamp_part%schedule_step) == 0:
return True
elif "," in schedule_part:
for schedule_part in schedule_part.split(","): for schedule_part in schedule_part.split(","):
if self._match([timestamp_part], [schedule_part]): if self._match([timestamp_part], [schedule_part]):
return True 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 == "*": elif schedule_part == "*":
return True return True