explicitly describe perform op in AttachmentsClenupWorker
authorRoman Chvanikov <chvanikoff@pm.me>
Tue, 28 Jan 2020 00:52:35 +0000 (03:52 +0300)
committerRoman Chvanikov <chvanikoff@pm.me>
Tue, 28 Jan 2020 00:52:50 +0000 (03:52 +0300)
lib/pleroma/workers/attachments_cleanup_worker.ex

index 595001ccbc8acd8dc4ab32eaf1217fab66c43cd9..23720ec56559fa990293d0b9a90af6cd7936486a 100644 (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