diff options
author | rinpatch <rinpatch@sdf.org> | 2019-09-15 20:22:17 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-09-15 20:22:17 +0000 |
commit | 2990c0a53b14646eab19b57d068ac8aa7e17ea4e (patch) | |
tree | 7681ac3405657948a062c396b70bb2f275e91238 /lib/pleroma/application.ex | |
parent | 9c64a25713790fefa8b5c419aeadf55113c17073 (diff) | |
parent | 3b8ec98b0e3b3fb2bd333f3be724676c4821366f (diff) | |
download | pleroma-2990c0a53b14646eab19b57d068ac8aa7e17ea4e.tar.gz |
Merge branch '1149-oban-job-queue' into 'develop'
[#1149] `oban`-based job & retry queues
Closes #1149
See merge request pleroma/pleroma!1518
Diffstat (limited to 'lib/pleroma/application.ex')
-rw-r--r-- | lib/pleroma/application.ex | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index 1d46925f8..49094704b 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -31,18 +31,19 @@ defmodule Pleroma.Application do children = [ Pleroma.Repo, + Pleroma.Scheduler, Pleroma.Config.TransferTask, Pleroma.Emoji, Pleroma.Captcha, Pleroma.FlakeId, - Pleroma.ScheduledActivityWorker, - Pleroma.ActivityExpirationWorker + Pleroma.Daemons.ScheduledActivityDaemon, + Pleroma.Daemons.ActivityExpirationDaemon ] ++ cachex_children() ++ hackney_pool_children() ++ [ - Pleroma.Web.Federator.RetryQueue, Pleroma.Stats, + {Oban, Pleroma.Config.get(Oban)}, %{ id: :web_push_init, start: {Task, :start_link, [&Pleroma.Web.Push.init/0]}, @@ -70,9 +71,7 @@ defmodule Pleroma.Application do # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html # for other strategies and supported options opts = [strategy: :one_for_one, name: Pleroma.Supervisor] - result = Supervisor.start_link(children, opts) - :ok = after_supervisor_start() - result + Supervisor.start_link(children, opts) end defp setup_instrumenters do @@ -164,17 +163,4 @@ defmodule Pleroma.Application do :hackney_pool.child_spec(pool, options) end end - - defp after_supervisor_start do - with digest_config <- Application.get_env(:pleroma, :email_notifications)[:digest], - true <- digest_config[:active] do - PleromaJobQueue.schedule( - digest_config[:schedule], - :digest_emails, - Pleroma.DigestEmailWorker - ) - end - - :ok - end end |