X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fpool%2Fsupervisor.ex;h=8dc5b64b727774328e7b315b18722cbf31201b7a;hb=d9f8941dac983d89709645831b41e02adc454740;hp=32be2264dcdc5e0cba3a859c5c4d76e56b35ce3d;hpb=514c899275a32e6ef63305f9424c50344d41b12e;p=akkoma
diff --git a/lib/pleroma/pool/supervisor.ex b/lib/pleroma/pool/supervisor.ex
index 32be2264d..8dc5b64b7 100644
--- a/lib/pleroma/pool/supervisor.ex
+++ b/lib/pleroma/pool/supervisor.ex
@@ -1,10 +1,11 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Pool.Supervisor do
use Supervisor
+ alias Pleroma.Config
alias Pleroma.Pool
def start_link(args) do
@@ -17,8 +18,7 @@ defmodule Pleroma.Pool.Supervisor do
%{
id: Pool.Connections,
start:
- {Pool.Connections, :start_link,
- [{:gun_connections, Pleroma.Config.get([:connections_pool])}]}
+ {Pool.Connections, :start_link, [{:gun_connections, Config.get([:connections_pool])}]}
}
] ++ pools()
@@ -26,7 +26,16 @@ defmodule Pleroma.Pool.Supervisor do
end
defp pools do
- for {pool_name, pool_opts} <- Pleroma.Config.get([:pools]) do
+ pools = Config.get(:pools)
+
+ pools =
+ if Config.get([Pleroma.Upload, :proxy_remote]) == false do
+ Keyword.delete(pools, :upload)
+ else
+ pools
+ end
+
+ for {pool_name, pool_opts} <- pools do
pool_opts
|> Keyword.put(:id, {Pool, pool_name})
|> Keyword.put(:name, pool_name)