From b5c46c09ecbe782c6ce9c44d48c291b5048e703d Mon Sep 17 00:00:00 2001 From: shibao Date: Fri, 25 Feb 2022 22:12:55 -0500 Subject: [PATCH] fix oban --- lib/lokal/accounts.ex | 1 + lib/lokal/application.ex | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/lokal/accounts.ex b/lib/lokal/accounts.ex index 00b79d4..60c2313 100644 --- a/lib/lokal/accounts.ex +++ b/lib/lokal/accounts.ex @@ -7,6 +7,7 @@ defmodule Lokal.Accounts do alias Lokal.{Mailer, Repo} alias Lokal.Accounts.{User, UserToken} alias Ecto.{Changeset, Multi} + alias Oban.Job ## Database getters diff --git a/lib/lokal/application.ex b/lib/lokal/application.ex index c55cf91..e6266a5 100644 --- a/lib/lokal/application.ex +++ b/lib/lokal/application.ex @@ -15,7 +15,9 @@ defmodule Lokal.Application do # Start the PubSub system {Phoenix.PubSub, name: Lokal.PubSub}, # Start the Endpoint (http/https) - LokalWeb.Endpoint + LokalWeb.Endpoint, + # Add Oban + {Oban, oban_config()} # Start a worker by calling: Lokal.Worker.start_link(arg) # {Lokal.Worker, arg} ] @@ -39,4 +41,8 @@ defmodule Lokal.Application do LokalWeb.Endpoint.config_change(changed, removed) :ok end + + defp oban_config do + Application.fetch_env!(:lokal, Oban) + end end