mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-14 04:08:46 +00:00
fix: daily, weekly and monthly automations can run twice or skip their first run (#32264)
Automations scheduled with the Daily, Weekly or Monthly picker ran a few seconds after the chosen time, taking the seconds from whenever the previous run was handled. Now and then that left the next run due again within the same minute, and the automation ran twice. Users whose timezone is behind the server's could also have their first run moved to the next day. These schedules now run at the exact minute chosen, in the user's own timezone. Fixes #32263
This commit is contained in:
parent
6f92cd78ee
commit
c89336da5f
1 changed files with 3 additions and 0 deletions
|
|
@ -64,6 +64,9 @@ def _parse_rule(s: str, now: Optional[datetime] = None):
|
|||
}.get(rule._freq)
|
||||
|
||||
if step is None:
|
||||
# dateutil's default anchor carries seconds and the server timezone
|
||||
if not has_dtstart:
|
||||
return rrulestr(stripped, dtstart=anchor.replace(second=0, microsecond=0), ignoretz=True)
|
||||
if not rule._dtstart.tzinfo:
|
||||
return parsed
|
||||
return rrulestr(stripped, dtstart=start, ignoretz=True)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue