Rework some Rich Media functionality for better error handling
Oban should not retry jobs that are likely to fail again
This commit is contained in:
parent
b4c5cc39f6
commit
d124d8645e
8 changed files with 70 additions and 50 deletions
|
|
@ -14,7 +14,17 @@ defmodule Pleroma.Workers.RichMediaWorker do
|
|||
end
|
||||
|
||||
def perform(%Job{args: %{"op" => "backfill", "url" => _url} = args}) do
|
||||
Backfill.run(args)
|
||||
case Backfill.run(args) do
|
||||
:ok ->
|
||||
:ok
|
||||
|
||||
{:error, type}
|
||||
when type in [:invalid_metadata, :body_too_large, :content_type, :validate] ->
|
||||
:cancel
|
||||
|
||||
error ->
|
||||
{:error, error}
|
||||
end
|
||||
end
|
||||
|
||||
@impl Oban.Worker
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue