dbprune: add --keep-followed and don't prune pinned posts by default #897

Merged
Oneric merged 4 commits from Oneric/akkoma:mix-prune_newopts into develop 2025-05-09 21:31:37 +00:00

4 commits

Author SHA1 Message Date
516827c356 mix/database: add keep-followed option for object pruning
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test/2 Pipeline was successful
ci/woodpecker/pr/test/1 Pipeline was successful
ci/woodpecker/pr/build-arm64 Pipeline was successful
ci/woodpecker/pr/build-amd64 Pipeline was successful
ci/woodpecker/pr/docs Pipeline was successful
ci/woodpecker/pull_request_closed/lint Pipeline was successful
ci/woodpecker/pull_request_closed/test/1 Pipeline was successful
ci/woodpecker/pull_request_closed/test/2 Pipeline was successful
ci/woodpecker/pull_request_closed/build-arm64 Pipeline was successful
ci/woodpecker/pull_request_closed/build-amd64 Pipeline was successful
ci/woodpecker/pull_request_closed/docs Pipeline was successful
This allows to retain posts and boosts of remote actors with local
follows regardless of age.
With the "full" setting this can be taken further treating such
followed actors just like local users even keeping all posts they
liked or reacated to.
2025-05-09 23:02:25 +02:00
8576ec42ec mix/database: retain pinned objects by default
Pinned objects and their threads will be refetched
on user refresh which by default happens after a day
once a user is encountered again in any form including a mention.

We observed pruning pinned objects usually results in heavy load for
hours after a database prune due to a clogged up remote fetch queue as
pinned posts and their threads of many (most?) users get refetched.

Thus do not prune pinned posts by default.
Keeping closer to earlier behaviour this will still prune threads of
pinned posts regardless of --keep-threads if nothing else prevenets it.
2025-05-09 23:00:14 +02:00
be5312228f cosmetic/mix/database: refactor log_message building
This is more concise and readable
2025-05-09 22:57:01 +02:00
9846460702 cosmetic/mix/database: refactor object prune into subfunctions
Statmenets for keeping and breaking threads vastly differ
and the whole if block doesn't even fit on one screen.
Thus move each version out into its own function to
improve readability
2025-05-09 22:57:01 +02:00