mix threadline.retention.purge (Threadline v0.2.0)

Copy Markdown View Source

Delegates to Threadline.Retention.purge/1 after loading application config and starting the configured Ecto repo (same resolution pattern as mix threadline.verify_coverage).

Configuration

Purge is a no-op (Mix raises) unless config :threadline, :retention, enabled: true and the rest of the map passes Threadline.Retention.Policy.validate_config!/1.

Flags

  • --batch-size — rows per delete pass (default 500 in purge/1).
  • --max-batches — safety cap on outer iterations.
  • --dry-run — counts eligible audit_changes / empty audit_transactions only; no deletes.
  • --executerequired when MIX_ENV=prod, in addition to enabled: true, so production crons cannot delete data from a mistyped command alone.

Examples

mix threadline.retention.purge --dry-run
mix threadline.retention.purge --batch-size 200 --max-batches 50

Production (after explicit config review):

MIX_ENV=prod mix threadline.retention.purge --execute --batch-size 500