As per title, what would you do if you want to reschedule the job for retrying with a different period depending on an error happening inside the job’s perform
function?
Our scenario is that we want to start with being very strict with the data we accept from a Kafka queue (the app is listening on messages and is scheduling Oban jobs) – but it’s possible we’ll overdo the strictness and that the Kafka message will actually be valid. For that purpose I want the jobs to remain in a :retryable
state but with a different retry period than what’s normally given.
I was thinking I can just snooze the job as that’s not draining its retry count, and this seems like the right fit. My only nitpicky worry is that it doesn’t seem conceptually correct – we are not aiming to snooze it, we aim to retry it later after the validation code has been relaxed – but I can very easily live with that.
Did I overlook a mechanism that people usually use in such scenario?
Also, does a mechanism exist that detects when the app is restarted which causes Oban to immediately retry certain jobs?