mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-14 04:52:17 +00:00
Consider errors during HTTP GET and HEAD to be unrecoverable and insert a negative cache entry
This is for a normal HTTP error response or timeout while receiving the data. A hard error from a process crash, DNS lookup failure, etc should produce a different response than {:ok, %Tesla.Env{}} and the request/job will be retryable.
This commit is contained in:
parent
731f7b87d2
commit
5a62868106
2 changed files with 2 additions and 10 deletions
|
@ -36,13 +36,9 @@ defmodule Pleroma.Web.RichMedia.Backfill do
|
|||
:ok
|
||||
|
||||
{:error, type} = error
|
||||
when type in [:invalid_metadata, :body_too_large, :content_type, :validate] ->
|
||||
when type in [:invalid_metadata, :body_too_large, :content_type, :validate, :get, :head] ->
|
||||
negative_cache(url_hash)
|
||||
error
|
||||
|
||||
{:error, type} = error
|
||||
when type in [:get, :head] ->
|
||||
error
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -20,13 +20,9 @@ defmodule Pleroma.Workers.RichMediaWorker do
|
|||
:ok
|
||||
|
||||
{:error, type}
|
||||
when type in [:invalid_metadata, :body_too_large, :content_type, :validate] ->
|
||||
when type in [:invalid_metadata, :body_too_large, :content_type, :validate, :get, :head] ->
|
||||
{:cancel, type}
|
||||
|
||||
{:error, type}
|
||||
when type in [:get, :head] ->
|
||||
{:error, type}
|
||||
|
||||
error ->
|
||||
{:error, error}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue