Fixing up deletes a bit (#327)
[akkoma] / lib / pleroma / workers / search_indexing_worker.ex
index 70a8d42d06cb00dc3c4e349c591c1e1ceaf510d1..518a44c0ada9e19b53ecb4a64b4f9f748ed2a114 100644 (file)
@@ -14,11 +14,10 @@ defmodule Pleroma.Workers.SearchIndexingWorker do
   end
 
   def perform(%Job{args: %{"op" => "remove_from_index", "object" => object_id}}) do
-    object = Pleroma.Object.get_by_id(object_id)
-
     search_module = Pleroma.Config.get([Pleroma.Search, :module])
 
-    search_module.remove_from_index(object)
+    # Fake the object so we can remove it from the index without having to keep it in the DB
+    search_module.remove_from_index(%Pleroma.Object{id: object_id})
 
     :ok
   end