Prune old job executions
All checks were successful
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
buildbot/nix-effects Build done.

This commit is contained in:
Abel Luck 2026-06-02 11:31:39 +02:00
parent 813f19f355
commit 710ac76192
6 changed files with 552 additions and 11 deletions

View file

@ -80,12 +80,16 @@ Operational notes:
Reordering `REPUBLISHER_IMAGE` changes canonical feed image URLs.
- Job logs and stats artifacts are written under `out/logs/`.
Media cleanup:
Maintenance cleanup:
- Published media can outlive the current feed when articles fall out of the
feed window. Use `cleanup-media` to delete old media files that are no longer
referenced by the latest published `feed.rss`.
- The default retention window is 25 days. Run a dry run first:
- The command also prunes completed job executions and their `out/logs/`
artifacts. Successful executions are retained for 7 days; failed or canceled
executions are retained for 90 days. Pending and running executions are not
pruned.
- The default media retention window is 25 days. Run a dry run first:
```sh
uv run repub cleanup-media --feeds-dir out/feeds --days 25 --dry-run
@ -93,9 +97,10 @@ uv run repub cleanup-media --feeds-dir out/feeds --days 25 --dry-run
- Remove `--dry-run` to delete matching files. The command protects media
referenced by the latest published feed, lists each matched file before the
aggregate summary, and uses a lock to avoid racing with active crawls.
aggregate summary, prunes old job execution rows and logs, and uses a lock to
avoid racing with active crawls.
- For config-driven deployments, pass the runtime config so cleanup uses the
configured `out_dir` and media directory names:
configured `out_dir`, media directory names, and job log directory:
```sh
uv run repub cleanup-media --config repub.toml --dry-run