From: Roman Chvanikov Date: Fri, 17 Jan 2020 17:20:37 +0000 (+0300) Subject: Delete attachments after object and cache cleanup X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=81133702d4246e5e5c17ea4d4119747dc880edd6;p=akkoma Delete attachments after object and cache cleanup --- diff --git a/lib/pleroma/object.ex b/lib/pleroma/object.ex index 6c56a9c62..499339982 100644 --- a/lib/pleroma/object.ex +++ b/lib/pleroma/object.ex @@ -180,10 +180,10 @@ defmodule Pleroma.Object do def delete(%Object{data: %{"id" => id}} = object) do with {:ok, _obj} = swap_object_with_tombstone(object), - :ok <- delete_attachments(object), deleted_activity = Activity.delete_all_by_object_ap_id(id), {:ok, true} <- Cachex.del(:object_cache, "object:#{id}"), - {:ok, _} <- Cachex.del(:web_resp_cache, URI.parse(id).path) do + {:ok, _} <- Cachex.del(:web_resp_cache, URI.parse(id).path), + :ok <- delete_attachments(object) do {:ok, object, deleted_activity} end end