From 54eacf52b3a3a307218e450480a22b474d37516d Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Sun, 24 Mar 2024 09:28:05 -0700 Subject: [PATCH] Added logging for job reset task --- lib/pinchflat/boot/pre_job_startup_tasks.ex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pinchflat/boot/pre_job_startup_tasks.ex b/lib/pinchflat/boot/pre_job_startup_tasks.ex index df9bb75..8572d8a 100644 --- a/lib/pinchflat/boot/pre_job_startup_tasks.ex +++ b/lib/pinchflat/boot/pre_job_startup_tasks.ex @@ -43,7 +43,12 @@ defmodule Pinchflat.Boot.PreJobStartupTasks do # in the "executing" state. This is a problem because the job runner will not # pick them up again 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 defp apply_default_settings do