Add config option for enabling/disabling chat.
This commit is contained in:
parent
15cb3f2b01
commit
f0745148a3
4 changed files with 14 additions and 3 deletions
|
|
@ -20,14 +20,18 @@ defmodule Pleroma.Application do
|
|||
limit: 2500
|
||||
]]),
|
||||
worker(Pleroma.Web.Federator, []),
|
||||
worker(Pleroma.Web.ChatChannel.ChatChannelState, []),
|
||||
worker(Pleroma.Stats, []),
|
||||
]
|
||||
++ if Mix.env == :test, do: [], else: [worker(Pleroma.Web.Streamer, [])]
|
||||
++ if !chat_enabled(), do: [], else: [worker(Pleroma.Web.ChatChannel.ChatChannelState, [])]
|
||||
|
||||
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
|
||||
# for other strategies and supported options
|
||||
opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
|
||||
Supervisor.start_link(children, opts)
|
||||
end
|
||||
|
||||
defp chat_enabled do
|
||||
Application.get_env(:pleroma, :chat, []) |> Keyword.get(:enabled)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue