diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a1ae9cb6..bab6c2580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Checking activated Upload Filters for required commands. - Remote users can no longer reappear after being deleted. - Deactivated users may now be deleted. +- Deleting an activity with a lot of likes/boosts no longer causes a database timeout. - Mix task `pleroma.database prune_objects` - Fixed rendering of JSON errors on ActivityPub endpoints. - Linkify: Parsing crash with URLs ending in unbalanced closed paren, no path separator, and no query parameters diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex index 6a991c48e..b88f74f47 100644 --- a/lib/pleroma/activity.ex +++ b/lib/pleroma/activity.ex @@ -302,7 +302,7 @@ def delete_all_by_object_ap_id(id) when is_binary(id) do |> Queries.by_object_id() |> Queries.exclude_type("Delete") |> select([u], u) - |> Repo.delete_all() + |> Repo.delete_all(timeout: :infinity) |> elem(1) |> Enum.find(fn %{data: %{"type" => "Create", "object" => ap_id}} when is_binary(ap_id) -> ap_id == id