retention: compose the audit detail in the store with the real body count
RetainWithAudit now takes only the actor; the store builds the detail after body clearing so bodies_cleared is a real number, and still writes the row before the cap. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -346,9 +346,7 @@ func runRetain(cfg *config.Config, logger *slog.Logger) error {
|
||||
}
|
||||
// The audit row is written inside the same transaction, before the cap, so
|
||||
// the cap counts it. This is what keeps actions_log bounded across runs.
|
||||
detail := fmt.Sprintf("bodies_cleared=%%d retention_days=%d max_rows=%d",
|
||||
cfg.RetentionDays, cfg.ActionsLogMaxRows)
|
||||
res, err := st.RetainWithAudit(ctx, policy, "scheduler", detail)
|
||||
res, err := st.RetainWithAudit(ctx, policy, "scheduler")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user