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
19 def start(_type, _args) do
22 # Define workers and child supervisors to be supervised
25 # Start the Ecto repository
26 supervisor(Pleroma.Repo, []),
27 worker(Pleroma.Emoji, []),
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, [])
74 # Start the endpoint when the application starts
75 supervisor(Pleroma.Web.Endpoint, []),
76 worker(Pleroma.Gopher.Server, [])
79 # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
80 # for other strategies and supported options
81 opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
82 Supervisor.start_link(children, opts)
85 if Mix.env() == :test do
86 defp streamer_child(), do: []
87 defp chat_child(), do: []
89 defp streamer_child() do
90 [worker(Pleroma.Web.Streamer, [])]
94 if Pleroma.Config.get([:chat, :enabled]) do
95 [worker(Pleroma.Web.ChatChannel.ChatChannelState, [])]