Added logging for job reset task
This commit is contained in:
parent
d0f7338f42
commit
54eacf52b3
1 changed files with 6 additions and 1 deletions
|
|
@ -43,7 +43,12 @@ defmodule Pinchflat.Boot.PreJobStartupTasks do
|
||||||
# in the "executing" state. This is a problem because the job runner will not
|
# in the "executing" state. This is a problem because the job runner will not
|
||||||
# pick them up again
|
# pick them up again
|
||||||
defp reset_executing_jobs do
|
defp reset_executing_jobs do
|
||||||
Repo.update_all(from(j in Oban.Job, where: j.state == "executing"), set: [state: "retryable"])
|
{count, _} =
|
||||||
|
Oban.Job
|
||||||
|
|> where(state: "executing")
|
||||||
|
|> Repo.update_all(set: [state: "retryable"])
|
||||||
|
|
||||||
|
Logger.info("Reset #{count} executing jobs")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_default_settings do
|
defp apply_default_settings do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue