Files
music_library/lib/last_fm/supervisor.ex
T
Claudio Ortolina 18ae8b7866 Refactor last_fm configuration
Move all configuration outside of the LastFm module, so that it's not
polluted with references to the parent music_library application.
2024-11-06 12:09:38 +00:00

20 lines
386 B
Elixir

defmodule LastFm.Supervisor do
use Supervisor
def start_link(config) do
Supervisor.start_link(__MODULE__, config, name: __MODULE__)
end
@impl true
def init(config) do
:ok = LastFm.Feed.create_table!()
children = [
{Phoenix.PubSub, name: LastFm.PubSub},
{LastFm.Refresh, config}
]
Supervisor.init(children, strategy: :one_for_one)
end
end