edgurgel / verk

A job processing system that just verks! 🧛‍

Home Page:https://hex.pm/packages/verk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

function Verk.Supervisor.start_link/1 is undefined or private

robinvdvleuten opened this issue · comments

I am trying to add Verk to my supervised processes in a Phoenix 1.4 application;

children = [
      MyApp.Repo,
      MyAppWeb.Endpoint,
      Verk.Supervisor
]

But whenever I start my application, I receive the following error;

** (Mix) Could not start application submit: MyApp.Application.start(:normal, []) returned an error: shutdown: failed to start child: Verk.Supervisor
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function Verk.Supervisor.start_link/1 is undefined or private

Could you please check which version of Verk is defined inside your mix.lock? It should be defined if it's loaded 🤔

Sure, that's the latest version (1.4.1). After investigating further, the problem is that the functions is defined as Verk.Supervisor.start_link/0 within Verk (https://github.com/edgurgel/verk/blob/master/lib/verk/supervisor.ex#L15). But that Phoenix / Supervisor expect it to be defined as Verk.Supervisor.start_link/1.

When changing the start_link method to something like;

def start_link(opts \\ []) do
  Supervisor.start_link(__MODULE__, opts, name: __MODULE__)
end

the issue seems to be solved solved.