sorentwo / oban

đź’Ž Robust job processing in Elixir, backed by modern PostgreSQL and SQLite3
https://getoban.pro
Apache License 2.0
3.17k stars 297 forks source link

Execution Deadline is ignoring the `scheduled_at` offset #1102

Closed tayjohno closed 3 weeks ago

tayjohno commented 3 weeks ago

Environment

Current Behavior

When scheduling a job with a scheduled_at and a deadline, the deadline is getting set relative to now instead of relative to scheduled_at.

Expected Behavior

The docs say the deadline should be relative to scheduled_at.

[...] That also allows the deadline to consider scheduling—a job scheduled to run 1 hour from now with a 1 hour deadline will expire 2 hours in the future. [...]

https://getoban.pro/docs/pro/1.4.9/Oban.Pro.Worker.html#module-job-deadlines

I dove into the code and confirmed that was the intention, there's just a typo.

sorentwo commented 3 weeks ago

Thanks for the fix, and tracking down the source. It's fixed on main and will be released in v1.4.10 soon.