add options to mix prune_objects to delete more things
Related issue: #3042
This is based on https://akkoma.dev/AkkomaGang/akkoma/pulls/350 and a few others. Commits:
- 7695010268d54bf7939fb1c2d5e33e7bce5b6989
- a7ec6e039cdc9ca5a0cc744fbd51511c5ede9f29
- 57eef6d76492e772f83acba2402d50ecb6a69f6b
- f49e9e6d4cb7cfdd0c2fbb2ea74c82a7ec7d13e4
- c1c962e1a80873a22cdc328fffb446f550892b10
This adds three options to mix prune_objects
:
-
--keep-threads
: Don't prune posts when they are part of a thread where at least one post has seen local interaction -
--keep-non-public
: Keep non-public posts like DM's and followers-only, even if they are remote. -
--prune-orphaned-activities
: Prune orphaned activities (Like, Announce, etc.) related to deleted posts. Note: very slow.
With --keep-non-public --prune-orphaned-activities
, my database shrunk by about 60%.
Breaking change: the current task does not remove non-public posts by default. With this PR, administrators will need to use the --keep-non-public
flag for the same behavior.
Checklist
-
Adding a changelog: In the changelog.d
directory, create a file named<code>.<type>
.