Merge branch 'fix/mediaproxy-too-brutal' into 'develop'

Make MediaProxy failure tracking less brutal

See merge request pleroma/pleroma!1836
This commit is contained in:
rinpatch 2019-10-12 14:42:55 +00:00
commit 930cbd6d05

View file

@ -401,11 +401,9 @@ defp increase_read_duration(_) do
defp client, do: Pleroma.ReverseProxy.Client
defp track_failed_url(url, code, opts) do
code = to_string(code)
defp track_failed_url(url, error, opts) do
ttl =
if code in ["403", "404"] or String.starts_with?(code, "5") do
unless error in [:body_too_large, 400, 204] do
Keyword.get(opts, :failed_request_ttl, @failed_request_ttl)
else
nil