diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-08-23 18:28:23 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-08-23 18:28:23 +0300 |
commit | 581123f8bb703023cb652267a1fc34292f862852 (patch) | |
tree | 7c4bb9fc62e7dfc35ea8c0d15715d2d4c31abe64 /lib/pleroma/application.ex | |
parent | c056736daaedb2a08557ee6c6a9bcb6bf44110ca (diff) | |
download | pleroma-581123f8bb703023cb652267a1fc34292f862852.tar.gz |
[#1149] Introduced `quantum` job scheduler. Documentation & config changes.
Diffstat (limited to 'lib/pleroma/application.ex')
-rw-r--r-- | lib/pleroma/application.ex | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index 384b03aa9..ce2d3ab59 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -31,6 +31,7 @@ defmodule Pleroma.Application do children = [ Pleroma.Repo, + Pleroma.Scheduler, Pleroma.Config.TransferTask, Pleroma.Emoji, Pleroma.Captcha, @@ -69,9 +70,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 @@ -162,18 +161,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 - # TODO: consider replacing with `quantum` scheduler - PleromaJobQueue.schedule( - digest_config[:schedule], - :digest_emails, - Pleroma.DigestEmailWorker - ) - end - - :ok - end end |