start chat deps through supervisor
This commit is contained in:
parent
90a2b50673
commit
7e10166065
19
lib/pleroma/application/chat_supervisor.ex
Normal file
19
lib/pleroma/application/chat_supervisor.ex
Normal file
@ -0,0 +1,19 @@
|
||||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Application.ChatSupervisor do
|
||||
use Supervisor
|
||||
|
||||
def start_link(_) do
|
||||
Supervisor.start_link(__MODULE__, :no_args)
|
||||
end
|
||||
|
||||
def init(_) do
|
||||
[
|
||||
Pleroma.Web.ChatChannel.ChatChannelState,
|
||||
{Phoenix.PubSub, [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2]}
|
||||
]
|
||||
|> Supervisor.init(strategy: :one_for_one)
|
||||
end
|
||||
end
|
@ -8,7 +8,7 @@ defmodule Pleroma.Application.ConfigDependentDeps do
|
||||
require Logger
|
||||
|
||||
@config_path_mods_relation [
|
||||
{{:pleroma, :chat}, Pleroma.Web.ChatChannel.ChatChannelState},
|
||||
{{:pleroma, :chat}, Pleroma.Application.ChatSupervisor},
|
||||
{{:pleroma, Oban}, Oban},
|
||||
{{:pleroma, :rate_limit}, Pleroma.Web.Plugs.RateLimiter.Supervisor},
|
||||
{{:pleroma, :streamer}, Pleroma.Web.Streamer.registry()},
|
||||
|
@ -178,10 +178,7 @@ defmodule Pleroma.Application.StartUpDependencies do
|
||||
|
||||
defp maybe_add_chat_child(children) do
|
||||
if Config.get([:chat, :enabled]) do
|
||||
[
|
||||
Pleroma.Web.ChatChannel.ChatChannelState,
|
||||
{Phoenix.PubSub, [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2]} | children
|
||||
]
|
||||
[Pleroma.Application.ChatSupervisor | children]
|
||||
else
|
||||
children
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user