[#58] pre-link MFM content (#59)
[akkoma] / lib / pleroma / application.ex
index 0f4f5a358d4a5c9555b19db17fb488141d2600a2..fcb1d65711c0d799e8635b9d90f7148a862608da 100644 (file)
@@ -58,9 +58,6 @@ defmodule Pleroma.Application do
     Pleroma.Docs.JSON.compile()
     limiters_setup()
 
-    Logger.info("Starting Finch")
-    Finch.start_link(name: MyFinch)
-
     # Define workers and child supervisors to be supervised
     children =
       [
@@ -70,6 +67,7 @@ defmodule Pleroma.Application do
         Pleroma.Web.Plugs.RateLimiter.Supervisor
       ] ++
         cachex_children() ++
+        http_children() ++
         [
           Pleroma.Stats,
           Pleroma.JobQueueMonitor,
@@ -276,4 +274,13 @@ defmodule Pleroma.Application do
       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