feat(monitor): auto-prune expired maintenance windows
CI / test (pull_request) Successful in 2m33s
CI / lint (pull_request) Successful in 56s
CI / vulncheck (pull_request) Successful in 50s

Background goroutine runs every 15 minutes, deletes maintenance windows
that expired beyond the retention period (default 7 days). Configurable
via UPTOP_MAINT_RETENTION env var (Go duration format).

Closes #72
This commit was merged in pull request #96.
This commit is contained in:
2026-06-05 18:27:42 -04:00
parent 33dc84449b
commit 21a1563e53
9 changed files with 156 additions and 35 deletions
+5
View File
@@ -379,6 +379,11 @@ func runServe(args []string) {
if aggStrategy != "" {
eng.SetAggStrategy(monitor.AggregationStrategy(aggStrategy))
}
if v := os.Getenv("UPTOP_MAINT_RETENTION"); v != "" {
if d, err := time.ParseDuration(v); err == nil && d > 0 {
eng.SetMaintRetention(d)
}
}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()