Skip to content

Commit

Permalink
Defensively check the pdict for inline testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sorentwo committed Jun 25, 2024
1 parent 4c0ac00 commit 140e49e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/oban/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,10 @@ defmodule Oban.Config do
end

defp inline_testing?(pid, default) do
{:dictionary, dictionary} = Process.info(pid, :dictionary)

Keyword.get(dictionary, :oban_testing, default) == :inline
case Process.info(pid, :dictionary) do
{:dictionary, dictionary} -> Keyword.get(dictionary, :oban_testing, default) == :inline
_ -> false
end
end

@doc false
Expand Down

0 comments on commit 140e49e

Please sign in to comment.