1 defmodule Pleroma.Application do
5 @version Mix.Project.config()[:version]
7 def version, do: @version
8 def named_version(), do: @name <> " " <> @version
10 # See http://elixir-lang.org/docs/stable/elixir/Application.html
11 # for more information on OTP Applications
13 def start(_type, _args) do
14 import Supervisor.Spec
17 # Define workers and child supervisors to be supervised
20 # Start the Ecto repository
21 supervisor(Pleroma.Repo, []),
22 worker(Pleroma.Emoji, []),
23 # Start the endpoint when the application starts
24 supervisor(Pleroma.Web.Endpoint, []),
25 # Start your own worker by calling: Pleroma.Worker.start_link(arg1, arg2, arg3)
26 # worker(Pleroma.Worker, [arg1, arg2, arg3]),
58 default: :timer.seconds(6 * 60 * 60),
59 interval: :timer.seconds(60)
66 worker(Pleroma.Web.Federator, []),
67 worker(Pleroma.Web.Federator.RetryQueue, []),
68 worker(Pleroma.Gopher.Server, []),
69 worker(Pleroma.Stats, [])
74 [worker(Pleroma.Web.Streamer, [])] ++
78 else: [worker(Pleroma.Web.ChatChannel.ChatChannelState, [])]
81 # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
82 # for other strategies and supported options
83 opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
84 Supervisor.start_link(children, opts)
88 Application.get_env(:pleroma, :chat, []) |> Keyword.get(:enabled)