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, []),
33 ttl_interval: :timer.seconds(60 * 2)
36 id: :cachex_used_captcha_cache
69 default: :timer.seconds(6 * 60 * 60),
70 interval: :timer.seconds(60)
77 worker(Pleroma.Web.Federator.RetryQueue, []),
78 worker(Pleroma.Web.Federator, []),
79 worker(Pleroma.Stats, []),
80 worker(Pleroma.Web.Push, [])
85 # Start the endpoint when the application starts
86 supervisor(Pleroma.Web.Endpoint, []),
87 worker(Pleroma.Gopher.Server, [])
90 # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
91 # for other strategies and supported options
92 opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
93 Supervisor.start_link(children, opts)
96 if Mix.env() == :test do
97 defp streamer_child(), do: []
98 defp chat_child(), do: []
100 defp streamer_child() do
101 [worker(Pleroma.Web.Streamer, [])]
105 if Pleroma.Config.get([:chat, :enabled]) do
106 [worker(Pleroma.Web.ChatChannel.ChatChannelState, [])]