sorentwo/oban

[Questions] Oban Jobs management

Closed this issue · 1 comments

Hello,

It's not an Issue neither a Feature request but I've some question about the best practice or maybe some answers are in next releases .

I'm facing some strangeness/issues with jobs management:

Back to the Future

When I reboot my service while having already some jobs in the database, ones in available state with a prior scheduled_at value than the reboot state stay in this state and are never run.

How can I avoid this behavior (for exemple run unrunned job that are waiting on boot)

Force run

Sometimes some jobs are not played at all, how could i force using an SQL update ?

Errored jobs

In the same idea, when the job reached the max attempts with errors, how could I retry all attempts ?

Please don't use the issue tracker for help requests. Instead, use Slack or the ElixirForum. However, since you've already asked:

When I reboot my service while having already some jobs in the database, ones in available state with a prior scheduled_at value than the reboot state stay in this state and are never run.

There's a section for this in the troubleshooting guide. But, this usually comes down to one of two issues:

  1. The queue those available jobs are in isn't running (check for typos)
  2. The Stager isn't able to run because plugins are disabled in production (stop using plugins: false)

Sometimes some jobs are not played at all, how could i force using an SQL update ?

There's no need to force them to run with raw SQL. Ensure the queue those jobs are in is running.

In the same idea, when the job reached the max attempts with errors, how could I retry all attempts ?

When jobs reach max_attempts they are discarded. You can use retry_all_jobs/2 to force a retry if necessary.