Start PubSub before Oban to prevent registry errors
Phoenix.PubSub must be initialized (creating its internal Registry) before Oban starts processing jobs. With one_for_one strategy, children start sequentially; previously Oban was started first, causing 'unknown registry: MusicLibrary.PubSub' errors when a job called broadcast before PubSub was ready (error #3891).
This commit is contained in:
@@ -19,11 +19,11 @@ defmodule MusicLibrary.Application do
|
||||
MusicLibrary.BackgroundRepo,
|
||||
MusicLibrary.TelemetryRepo,
|
||||
MusicLibraryWeb.Telemetry,
|
||||
{Phoenix.PubSub, name: MusicLibrary.PubSub},
|
||||
{Oban, Application.fetch_env!(:music_library, Oban)},
|
||||
{Ecto.Migrator,
|
||||
repos: Application.fetch_env!(:music_library, :ecto_repos), skip: skip_migrations?()},
|
||||
{Task.Supervisor, name: MusicLibrary.TaskSupervisor},
|
||||
{Phoenix.PubSub, name: MusicLibrary.PubSub},
|
||||
# Start a worker by calling: MusicLibrary.Worker.start_link(arg)
|
||||
# {MusicLibrary.Worker, arg},
|
||||
# Start to serve requests, typically the last entry
|
||||
|
||||
Reference in New Issue
Block a user