Skip to content

Instantly share code, notes, and snippets.

@ExuCounter
Created September 25, 2024 13:50
ProcessingLibrary.Supervisor
defmodule ProcessingLibrary.Supervisor do
use Supervisor
def start_link(opts) do
Supervisor.start_link(__MODULE__, :ok, opts)
end
@impl true
def init(:ok) do
children = []
children =
if Mix.env() != :test do
children ++
[
ProcessingLibrary.Database,
ProcessingLibrary.QueueWorker
]
else
children
end
Supervisor.init(children, strategy: :one_for_one)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment