Skip to content

Commit

Permalink
fix problem with non-exported function (#603)
Browse files Browse the repository at this point in the history
* fix problem with non-exported function

* refactor (accept suggestion)
  • Loading branch information
maxpohlmann authored Feb 29, 2024
1 parent c37db3a commit 95d742e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/quantum.ex
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,11 @@ defmodule Quantum do
defp duplicate_job?(existent_jobs, %Job{name: name}), do: Enum.member?(existent_jobs, name)

defp invalid_job_task?(%Job{task: {m, f, args}})
when is_atom(m) and is_atom(f) and is_list(args),
do: not function_exported?(m, f, length(args))
when is_atom(m) and is_atom(f) and is_list(args) do
if Code.ensure_loaded?(m),
do: not function_exported?(m, f, length(args)),
else: true
end

defp invalid_job_task?(_), do: false

Expand Down

0 comments on commit 95d742e

Please sign in to comment.