projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/warning-in-test' into 'develop'
[akkoma]
/
lib
/
pleroma
/
http
/
adapter_helper
/
gun.ex
diff --git
a/lib/pleroma/http/adapter_helper/gun.ex
b/lib/pleroma/http/adapter_helper/gun.ex
index 4a967d8f2150d4a3330eeeed5e34c7823a1e0814..82c7fd65482f4e62a521809287cd28e8ef93ac2e 100644
(file)
--- a/
lib/pleroma/http/adapter_helper/gun.ex
+++ b/
lib/pleroma/http/adapter_helper/gun.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.HTTP.AdapterHelper.Gun do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.HTTP.AdapterHelper.Gun do
@@
-11,12
+11,8
@@
defmodule Pleroma.HTTP.AdapterHelper.Gun do
require Logger
@defaults [
require Logger
@defaults [
- connect_timeout: 5_000,
- domain_lookup_timeout: 5_000,
- tls_handshake_timeout: 5_000,
retry: 1,
retry: 1,
- retry_timeout: 1000,
- await_up_timeout: 5_000
+ retry_timeout: 1_000
]
@type pool() :: :federation | :upload | :media | :default
]
@type pool() :: :federation | :upload | :media | :default
@@
-45,15
+41,17
@@
defmodule Pleroma.HTTP.AdapterHelper.Gun do
end
defp put_timeout(opts) do
end
defp put_timeout(opts) do
+ {recv_timeout, opts} = Keyword.pop(opts, :recv_timeout, pool_timeout(opts[:pool]))
# this is the timeout to receive a message from Gun
# this is the timeout to receive a message from Gun
- Keyword.put_new(opts, :timeout, pool_timeout(opts[:pool]))
+ # `:timeout` key is used in Tesla
+ Keyword.put(opts, :timeout, recv_timeout)
end
@spec pool_timeout(pool()) :: non_neg_integer()
def pool_timeout(pool) do
end
@spec pool_timeout(pool()) :: non_neg_integer()
def pool_timeout(pool) do
- default = Config.get([:pools, :default, :timeout], 5_000)
+ default = Config.get([:pools, :default, :
recv_
timeout], 5_000)
- Config.get([:pools, pool, :timeout], default)
+ Config.get([:pools, pool, :
recv_
timeout], default)
end
@prefix Pleroma.Gun.ConnectionPool
end
@prefix Pleroma.Gun.ConnectionPool