projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Merge branch 'issue/1023' into 'develop'"
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
mrf
/
media_proxy_warming_policy.ex
diff --git
a/lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex
b/lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex
index d9a0acfd3959f399d269e36dc28f626115ed2ac3..dfab105a3e4fe6d7616a9b95dfba5cd064186e93 100644
(file)
--- a/
lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex
+++ b/
lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex
@@
-12,17
+12,23
@@
defmodule Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy do
require Logger
require Logger
- @hackney_options [
- pool: :media,
- recv_timeout: 10_000
+ @options [
+ pool: :media
]
def perform(:prefetch, url) do
Logger.debug("Prefetching #{inspect(url)}")
]
def perform(:prefetch, url) do
Logger.debug("Prefetching #{inspect(url)}")
+ opts =
+ if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Hackney do
+ Keyword.put(@options, :recv_timeout, 10_000)
+ else
+ @options
+ end
+
url
|> MediaProxy.url()
url
|> MediaProxy.url()
- |> HTTP.get([], adapter:
@hackney_option
s)
+ |> HTTP.get([], adapter:
opt
s)
end
def perform(:preload, %{"object" => %{"attachment" => attachments}} = _message) do
end
def perform(:preload, %{"object" => %{"attachment" => attachments}} = _message) do