feat(retention): run eviction from an Oban cron worker

Adds config :pleroma, :retention (disabled by default) and an hourly
crontab entry that evicts one bounded batch per run.
This commit is contained in:
Lain Soykaf 2026-09-02 11:53:42 +04:00
commit cd796f007d
No known key found for this signature in database
4 changed files with 126 additions and 1 deletions

View file

@ -3310,6 +3310,40 @@ config :pleroma, :config_description, [
}
]
},
%{
group: :pleroma,
key: :retention,
type: :group,
description:
"Bounded retention: continuously evict old remote threads nobody local interacted with." <>
" Local posts and threads with local interactions are always kept.",
children: [
%{
key: :enabled,
type: :boolean,
description: "Run the retention worker from the Oban crontab"
},
%{
key: :max_objects,
type: :integer,
description:
"Optional watermark. When the objects table is estimated to hold more rows than this," <>
" the oldest unpinned remote threads are evicted regardless of their age.",
suggestions: [nil, 1_000_000]
},
%{
key: :batch_size,
type: :integer,
description: "Maximum number of threads to evict per worker run. Default: 500.",
suggestions: [500]
},
%{
key: :keep_non_public,
type: :boolean,
description: "Also keep threads that contain non-public posts"
}
]
},
%{
group: :ex_aws,
key: :s3,