From 82c79ca31893af11c6679d3902ef658843aaa5f5 Mon Sep 17 00:00:00 2001 From: Antoine Augusti Date: Sun, 29 Dec 2024 18:53:13 +0100 Subject: [PATCH] =?UTF-8?q?Transport.Jobs.Workflow=20:=20g=C3=A9rer=20Oban?= =?UTF-8?q?.TimeoutError=20(#4409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/transport/lib/jobs/workflow.ex | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/transport/lib/jobs/workflow.ex b/apps/transport/lib/jobs/workflow.ex index 906eec5abc..07a813af92 100644 --- a/apps/transport/lib/jobs/workflow.ex +++ b/apps/transport/lib/jobs/workflow.ex @@ -82,7 +82,7 @@ defmodule Transport.Jobs.Workflow do {:notification, :gossip, %{"success" => false, "job_id" => ^job_id} = notif} -> reason = notif |> Map.get("reason", "unknown reason") - {:error, "Job #{job_id} has failed: #{inspect(reason)}. Workflow is stopping here"} + {:error, "Job #{job_id} has failed: #{reason}. Workflow is stopping here"} end end end @@ -173,10 +173,17 @@ defmodule Transport.Jobs.Workflow do }, nil ) do + # `error` can be an error message or an `Oban.TimeoutError` exception. + # ```` + # %Oban.TimeoutError{ + # message: "Transport.Jobs.ResourceHistoryJob timed out after 1000ms", + # reason: :timeout + # } + # ``` Notifier.notify_workflow(%{meta: %{"workflow" => true}}, %{ "success" => false, "job_id" => job_id, - "reason" => error + "reason" => inspect(error) }) end