diff --git a/app/service/app_svc.py b/app/service/app_svc.py index 3b221e633..53e0b1f41 100644 --- a/app/service/app_svc.py +++ b/app/service/app_svc.py @@ -84,6 +84,10 @@ async def run_scheduler(self): interval = 60 for s in await self.get_service('data_svc').locate('schedules'): now = datetime.now(timezone.utc) + if not croniter.croniter.is_valid(s.schedule): + self.log.warning(f"The schedule {s.id} with the format `{s.schedule}` is incompatible with cron!") + continue + cron = croniter.croniter(s.schedule, now) diff = now - cron.get_prev(datetime) if interval > diff.total_seconds() > 0: