Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion interactions/models/internal/tasks/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ def next_fire(self) -> datetime | None:
)
if target.tzinfo == timezone.utc:
target = target.astimezone(now.tzinfo)
target = target.replace(tzinfo=None)
# target can fall behind or go forward a day, but all we need is the time itself
# to be converted
# to ensure it's on the same day as "now" and not break the next if statement,
# we can just replace the date with now's date
target = target.replace(year=now.year, month=now.month, day=now.day, tzinfo=None)

if target <= self.last_call_time:
target += timedelta(days=1)
Expand Down