1 defmodule Pleroma.Application do
6 @version Mix.Project.config()[:version]
8 def version, do: @version
9 def named_version(), do: @name <> " " <> @version
11 # See http://elixir-lang.org/docs/stable/elixir/Application.html
12 # for more information on OTP Applications
14 def start(_type, _args) do
17 # Define workers and child supervisors to be supervised
20 # Start the Ecto repository
21 supervisor(Pleroma.Repo, []),
22 worker(Pleroma.Emoji, []),
54 default: :timer.seconds(6 * 60 * 60),
55 interval: :timer.seconds(60)
62 worker(Pleroma.Web.Federator.RetryQueue, []),
63 worker(Pleroma.Web.Federator, []),
64 worker(Pleroma.Stats, [])
69 # Start the endpoint when the application starts
70 supervisor(Pleroma.Web.Endpoint, []),
71 worker(Pleroma.Gopher.Server, [])
74 # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
75 # for other strategies and supported options
76 opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
77 Supervisor.start_link(children, opts)
80 if Mix.env() == :test do
81 defp streamer_child(), do: []
82 defp chat_child(), do: []
84 defp streamer_child() do
85 [worker(Pleroma.Web.Streamer, [])]
89 if Pleroma.Config.get([:chat, :enabled]) do
90 [worker(Pleroma.Web.ChatChannel.ChatChannelState, [])]