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 3, 2024
1 parent 545c10f commit 33e460f
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

2 comments on commit 33e460f

@jfpedroza
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorentwo I'm experiencing the error this commit solves. Could you release a new version?

@sorentwo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Released in Oban v2.17.11 馃檪

Please sign in to comment.