Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/reactor/executor/step_runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ defmodule Reactor.Executor.StepRunner do
defp handle_compensate_result(:retry, reactor, step, arguments, context, reason) do
Hooks.event(reactor, :compensate_retry, step, context)

case Step.backoff(step, reason, arguments, context) do
case Step.backoff(step, reason.error, arguments, context) do
delay when is_integer(delay) and delay > 0 -> {:backoff, delay, {:retry, reason}}
_ -> {:retry, reason}
end
Expand Down
2 changes: 1 addition & 1 deletion test/reactor/executor/step_runner_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ defmodule Reactor.Executor.StepRunnerTest do
Example.Step.Compensable
|> stub(:run, fn _, _, _ -> {:error, :doc} end)
|> stub(:compensate, fn :doc, _, _, _ -> :retry end)
|> stub(:backoff, fn _, _, _, _ -> 100 end)
|> stub(:backoff, fn :doc, _, _, _ -> 100 end)

assert {:backoff, 100, {:retry, %RunStepError{error: :doc}}} =
run(reactor, state, step, nil)
Expand Down
Loading