# Disable warnings_as_errors at runtime, it breaks Phoenix live reload
# due to protocol consolidation warnings
Code.compiler_options(warnings_as_errors: false)
- Pleroma.Telemetry.Logger.attach()
Config.Holder.save_default()
Pleroma.HTML.compile_scrubbers()
Pleroma.Config.Oban.warn()
Pleroma.Docs.JSON.compile()
limiters_setup()
- Logger.info("Starting Finch")
- Finch.start_link(name: MyFinch)
-
# Define workers and child supervisors to be supervised
children =
[
Pleroma.Web.Plugs.RateLimiter.Supervisor
] ++
cachex_children() ++
+ http_children() ++
[
Pleroma.Stats,
Pleroma.JobQueueMonitor,
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
- opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
+ # If we have a lot of caches, default max_restarts can cause test
+ # resets to fail.
+ # Go for the default 3 unless we're in test
+ max_restarts =
+ if @mix_env == :test do
+ 100
+ else
+ 3
+ end
+
+ opts = [strategy: :one_for_one, name: Pleroma.Supervisor, max_restarts: max_restarts]
result = Supervisor.start_link(children, opts)
set_postgres_server_version()
ConcurrentLimiter.new(module, max_running, max_waiting)
end)
end
+
+ defp http_children do
+ config =
+ [:http, :adapter]
+ |> Config.get([])
+ |> Keyword.put(:name, MyFinch)
+
+ [{Finch, config}]
+ end
end