summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2020-03-07 12:24:39 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2020-03-07 12:24:39 +0300
commit5f42ecc4c74172b1b17c126106fda9da24065b11 (patch)
tree496a4b5c0aa4cbc30d7a517f48646c26c078a03f
parent9f884a263904c8b243507d35b29da712a31fb444 (diff)
downloadpleroma-5f42ecc4c74172b1b17c126106fda9da24065b11.tar.gz
pleroma-5f42ecc4c74172b1b17c126106fda9da24065b11.zip
start gun upload pool, if proxy_remote is enabled
-rw-r--r--lib/pleroma/pool/supervisor.ex15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/pleroma/pool/supervisor.ex b/lib/pleroma/pool/supervisor.ex
index f436849ac..8dc5b64b7 100644
--- a/lib/pleroma/pool/supervisor.ex
+++ b/lib/pleroma/pool/supervisor.ex
@@ -5,6 +5,7 @@
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)