[#217] Casting `get_next` to `datetime` to prevent DST issues

This commit is contained in:
Fabio Manganiello 2022-04-28 23:29:45 +02:00
parent e9454b0c0f
commit 55958c1b57
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 2 additions and 2 deletions

View File

@ -90,8 +90,8 @@ class Cronjob(threading.Thread):
now = get_now()
self._event_type = CronjobEvent.NONE
cron = croniter.croniter(self.cron_expression, now)
next_run = cron.get_next()
self._event.wait(max(0, next_run - now.timestamp()))
next_run = cron.get_next(datetime.datetime)
self._event.wait(max(0, (next_run - now).total_seconds()))
def stop(self):
self._event_type = CronjobEvent.STOP