Skip to content

Commit

Permalink
Transport.Jobs.Workflow : gérer Oban.TimeoutError (#4409)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineAugusti authored Dec 29, 2024
1 parent 0e5c479 commit 82c79ca
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/transport/lib/jobs/workflow.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 82c79ca

Please sign in to comment.