Skip to content

Commit 95d742e

Browse files
authored
fix problem with non-exported function (#603)
* fix problem with non-exported function * refactor (accept suggestion)
1 parent c37db3a commit 95d742e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/quantum.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,11 @@ defmodule Quantum do
342342
defp duplicate_job?(existent_jobs, %Job{name: name}), do: Enum.member?(existent_jobs, name)
343343

344344
defp invalid_job_task?(%Job{task: {m, f, args}})
345-
when is_atom(m) and is_atom(f) and is_list(args),
346-
do: not function_exported?(m, f, length(args))
345+
when is_atom(m) and is_atom(f) and is_list(args) do
346+
if Code.ensure_loaded?(m),
347+
do: not function_exported?(m, f, length(args)),
348+
else: true
349+
end
347350

348351
defp invalid_job_task?(_), do: false
349352

0 commit comments

Comments
 (0)