From: rinpatch Date: Sat, 12 Oct 2019 14:42:55 +0000 (+0000) Subject: Merge branch 'fix/mediaproxy-too-brutal' into 'develop' X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=a8afbe977a85580f23598a9928525b33fe7fd3fd;p=akkoma Merge branch 'fix/mediaproxy-too-brutal' into 'develop' Make MediaProxy failure tracking less brutal See merge request pleroma/pleroma!1836 (cherry picked from commit 930cbd6d05653033e9f6d16960d698f5db4ae624) 9bdbf081 Make MediaProxy failure tracking less brutal --- diff --git a/lib/pleroma/reverse_proxy/reverse_proxy.ex b/lib/pleroma/reverse_proxy/reverse_proxy.ex index 78144cae3..2ed719315 100644 --- a/lib/pleroma/reverse_proxy/reverse_proxy.ex +++ b/lib/pleroma/reverse_proxy/reverse_proxy.ex @@ -401,11 +401,9 @@ defmodule Pleroma.ReverseProxy 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