diff options
author | kaniini <ariadne@dereferenced.org> | 2019-10-04 17:39:28 +0000 |
---|---|---|
committer | kaniini <ariadne@dereferenced.org> | 2019-10-04 17:39:28 +0000 |
commit | ca6f1644aa72e9f3b56e57b8b6dfc0830d44648a (patch) | |
tree | 3ee414167996edf5bc39851482c7972673020147 /lib/pleroma/application.ex | |
parent | 222c238e7b807853dc02a79e00273b5f6b70eb4b (diff) | |
parent | d9e0108baacbe26a2f594d6f2badec58010ff1f9 (diff) | |
download | pleroma-ca6f1644aa72e9f3b56e57b8b6dfc0830d44648a.tar.gz |
Merge branch 'bugfix/widen-streamer-blocks-for-1.1' into 'maint/1.1'
widen streaming API blocks (for 1.1)
See merge request pleroma/pleroma!1785
Diffstat (limited to 'lib/pleroma/application.ex')
-rw-r--r-- | lib/pleroma/application.ex | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index 1d46925f8..9c95ce666 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -42,23 +42,9 @@ defmodule Pleroma.Application do hackney_pool_children() ++ [ Pleroma.Web.Federator.RetryQueue, - Pleroma.Stats, - %{ - id: :web_push_init, - start: {Task, :start_link, [&Pleroma.Web.Push.init/0]}, - restart: :temporary - }, - %{ - id: :federator_init, - start: {Task, :start_link, [&Pleroma.Web.Federator.init/0]}, - restart: :temporary - }, - %{ - id: :internal_fetch_init, - start: {Task, :start_link, [&Pleroma.Web.ActivityPub.InternalFetchActor.init/0]}, - restart: :temporary - } + Pleroma.Stats ] ++ + task_children(@env) ++ oauth_cleanup_child(oauth_cleanup_enabled?()) ++ streamer_child(@env) ++ chat_child(@env, chat_enabled?()) ++ @@ -70,9 +56,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 @@ -142,7 +126,7 @@ defmodule Pleroma.Application do defp streamer_child(:test), do: [] defp streamer_child(_) do - [Pleroma.Web.Streamer] + [Pleroma.Web.Streamer.supervisor()] end defp oauth_cleanup_child(true), @@ -165,16 +149,38 @@ defmodule Pleroma.Application do 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 + defp task_children(:test) do + [ + %{ + id: :web_push_init, + start: {Task, :start_link, [&Pleroma.Web.Push.init/0]}, + restart: :temporary + }, + %{ + id: :federator_init, + start: {Task, :start_link, [&Pleroma.Web.Federator.init/0]}, + restart: :temporary + } + ] + end - :ok + defp task_children(_) do + [ + %{ + id: :web_push_init, + start: {Task, :start_link, [&Pleroma.Web.Push.init/0]}, + restart: :temporary + }, + %{ + id: :federator_init, + start: {Task, :start_link, [&Pleroma.Web.Federator.init/0]}, + restart: :temporary + }, + %{ + id: :internal_fetch_init, + start: {Task, :start_link, [&Pleroma.Web.ActivityPub.InternalFetchActor.init/0]}, + restart: :temporary + } + ] end end |