Replace delay
with scheduled_for
?
#56
Replies: 1 comment 7 replies
-
One of the reasons for using intervals is to ensure that all the time zone conversions happen in Postgres. Notice how we always use Postgres to create timestamps and only use spans that are converted to intervals as application-level parameters. I think it would also be a little misleading to say it's scheduled for a particular wall clock instant because in reality it's not (the scheduler is required for that). Instead it's actually a duration before which the task can't be dequeued and after which it may or may not be. So I generally think interval delays are a slightly more appropriate interface. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://github.com/maxcountryman/underway/blob/main/migrations/20240921151751_0.sql#L50
Currently the delayed tasks are implemented via
delay
field.Wdyt about adjusting this slightly, so it rely on
scheduler_for
.so instead of
and created_at + delay <= now()
, it will checkscheduled_for <= now()
?The only reason it feels a bit "cleaner" for schedule for a specific time (and makes query a little simpler).
it is very subjective, thus currious about your opinion on this?
(of course it can also be solved with a fn that makes
delay
out of schedule_for), but this way (`schedule_for) "feels" cleaner for me for both schedule and dequeue)Beta Was this translation helpful? Give feedback.
All reactions