Constraint for state = available AND attempts = max_attempts
#1207
Labels
area:oss
Related to Oban OSS
kind:enhancement
New feature or request
note:discussion
Details or approval are up for discussion
Hi @sorentwo 👋
Environment
PostgreSQL Version: AWS Aurora PostgreSQL, engine version 15.8
Elixir & Erlang/OTP Versions (
elixir --version
):What Happened
Last week, this happened in our Oban setup:
Oban.retry_all_jobs/1
, but alas, middle-of-the-incident mentality! So, we manually updated theoban_jobs
table and set the state of the jobs to retry toavailable
.state = available
butattempts = max_attempts
.My question is: should there be an invariant in the system (in the form of a constraint?), where Postgres forbids you to set
state
toavailable
ifattempts = max_attempts
?The text was updated successfully, but these errors were encountered: