start gun upload pool, if proxy_remote is enabled
This commit is contained in:
parent
9f884a2639
commit
5f42ecc4c7
1 changed files with 12 additions and 3 deletions
|
@ -5,6 +5,7 @@
|
||||||
defmodule Pleroma.Pool.Supervisor do
|
defmodule Pleroma.Pool.Supervisor do
|
||||||
use Supervisor
|
use Supervisor
|
||||||
|
|
||||||
|
alias Pleroma.Config
|
||||||
alias Pleroma.Pool
|
alias Pleroma.Pool
|
||||||
|
|
||||||
def start_link(args) do
|
def start_link(args) do
|
||||||
|
@ -17,8 +18,7 @@ defmodule Pleroma.Pool.Supervisor do
|
||||||
%{
|
%{
|
||||||
id: Pool.Connections,
|
id: Pool.Connections,
|
||||||
start:
|
start:
|
||||||
{Pool.Connections, :start_link,
|
{Pool.Connections, :start_link, [{:gun_connections, Config.get([:connections_pool])}]}
|
||||||
[{:gun_connections, Pleroma.Config.get([:connections_pool])}]}
|
|
||||||
}
|
}
|
||||||
] ++ pools()
|
] ++ pools()
|
||||||
|
|
||||||
|
@ -26,7 +26,16 @@ defmodule Pleroma.Pool.Supervisor do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp pools do
|
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
|
pool_opts
|
||||||
|> Keyword.put(:id, {Pool, pool_name})
|
|> Keyword.put(:id, {Pool, pool_name})
|
||||||
|> Keyword.put(:name, pool_name)
|
|> Keyword.put(:name, pool_name)
|
||||||
|
|
Loading…
Reference in a new issue