projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'remotes/origin/develop' into 1364-no-pushes-from-blocke...
[akkoma]
/
lib
/
pleroma
/
pool
/
supervisor.ex
diff --git
a/lib/pleroma/pool/supervisor.ex
b/lib/pleroma/pool/supervisor.ex
index 32be2264dcdc5e0cba3a859c5c4d76e56b35ce3d..faf646cb2b09cb498fbe15afc8f151eb91c8fa32 100644
(file)
--- a/
lib/pleroma/pool/supervisor.ex
+++ b/
lib/pleroma/pool/supervisor.ex
@@
-1,10
+1,11
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Pool.Supervisor do
use Supervisor
# 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
alias Pleroma.Pool
def start_link(args) do
@@
-12,21
+13,26
@@
defmodule Pleroma.Pool.Supervisor do
end
def init(_) do
end
def init(_) do
- children =
- [
- %{
- id: Pool.Connections,
- start:
- {Pool.Connections, :start_link,
- [{:gun_connections, Pleroma.Config.get([:connections_pool])}]}
- }
- ] ++ pools()
-
- Supervisor.init(children, strategy: :one_for_one)
+ conns_child = %{
+ id: Pool.Connections,
+ start:
+ {Pool.Connections, :start_link, [{:gun_connections, Config.get([:connections_pool])}]}
+ }
+
+ Supervisor.init([conns_child | pools()], strategy: :one_for_one)
end
defp pools 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)
pool_opts
|> Keyword.put(:id, {Pool, pool_name})
|> Keyword.put(:name, pool_name)