1 defmodule Pleroma.Application do
6 @version Mix.Project.config()[:version]
8 def version, do: @version
9 def named_version(), do: @name <> " " <> @version
12 info = "#{Pleroma.Web.base_url()} <#{Pleroma.Config.get([:instance, :email], "")}>"
13 named_version() <> "; " <> info
16 # See http://elixir-lang.org/docs/stable/elixir/Application.html
17 # for more information on OTP Applications
18 def start(_type, _args) do
21 # Define workers and child supervisors to be supervised
24 # Start the Ecto repository
25 supervisor(Pleroma.Repo, []),
26 worker(Pleroma.Emoji, []),
27 worker(Pleroma.Captcha, []),
59 default: :timer.seconds(6 * 60 * 60),
60 interval: :timer.seconds(60)
67 worker(Pleroma.Web.Federator.RetryQueue, []),
68 worker(Pleroma.Web.Federator, []),
69 worker(Pleroma.Stats, []),
70 worker(Pleroma.Web.Push, [])
75 # Start the endpoint when the application starts
76 supervisor(Pleroma.Web.Endpoint, []),
77 worker(Pleroma.Gopher.Server, [])
80 # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
81 # for other strategies and supported options
82 opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
83 Supervisor.start_link(children, opts)
86 if Mix.env() == :test do
87 defp streamer_child(), do: []
88 defp chat_child(), do: []
90 defp streamer_child() do
91 [worker(Pleroma.Web.Streamer, [])]
95 if Pleroma.Config.get([:chat, :enabled]) do
96 [worker(Pleroma.Web.ChatChannel.ChatChannelState, [])]