explicitly describe perform op in AttachmentsClenupWorker

This commit is contained in:
Roman Chvanikov 2020-01-28 03:52:35 +03:00
parent 86c4b76bf0
commit 52e08ec9fd

View File

@ -12,7 +12,10 @@ defmodule Pleroma.Workers.AttachmentsCleanupWorker do
@impl Oban.Worker
def perform(
%{"object" => %{"data" => %{"attachment" => [_ | _] = attachments, "actor" => actor}}},
%{
"op" => "cleanup_attachments",
"object" => %{"data" => %{"attachment" => [_ | _] = attachments, "actor" => actor}}
} = data,
_job
) do
hrefs =
@ -84,5 +87,5 @@ defmodule Pleroma.Workers.AttachmentsCleanupWorker do
|> Repo.delete_all()
end
def perform(%{"object" => _object}, _job), do: :ok
def perform(%{"op" => "cleanup_attachments", "object" => _object}, _job), do: :ok
end