This commit is contained in:
shibao 2022-02-25 22:12:55 -05:00
parent 70bcc52c23
commit dbcd2c5cd9
2 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,7 @@ defmodule Lokal.Accounts do
alias Lokal.{Mailer, Repo} alias Lokal.{Mailer, Repo}
alias Lokal.Accounts.{User, UserToken} alias Lokal.Accounts.{User, UserToken}
alias Ecto.{Changeset, Multi} alias Ecto.{Changeset, Multi}
alias Oban.Job
## Database getters ## Database getters

View File

@ -15,7 +15,9 @@ defmodule Lokal.Application do
# Start the PubSub system # Start the PubSub system
{Phoenix.PubSub, name: Lokal.PubSub}, {Phoenix.PubSub, name: Lokal.PubSub},
# Start the Endpoint (http/https) # Start the Endpoint (http/https)
LokalWeb.Endpoint LokalWeb.Endpoint,
# Add Oban
{Oban, oban_config()}
# Start a worker by calling: Lokal.Worker.start_link(arg) # Start a worker by calling: Lokal.Worker.start_link(arg)
# {Lokal.Worker, arg} # {Lokal.Worker, arg}
] ]
@ -39,4 +41,8 @@ defmodule Lokal.Application do
LokalWeb.Endpoint.config_change(changed, removed) LokalWeb.Endpoint.config_change(changed, removed)
:ok :ok
end end
defp oban_config do
Application.fetch_env!(:lokal, Oban)
end
end end