• AlexRUS1234's avatar
    engine: eviction periodic runner with metrics
    · 83284d2b
    AlexRUS1234 создал
    Session 201 of the eviction wave: triggers for the proxy cache cleanup.
    
    - eviction.Runner mirrors retention.Runner: Remotes → proxy+Enabled+policy
      filter → Apply (no reindex — the cache has none), one remote failure goes
      to OnPass and the aggregate while the pass continues, ctx.Err() between
      remotes, Run is a WithoutCancel ticker, Stop is idempotent without a final
      pass.
    - config: [eviction] block with interval (24h default), global policy default
      min_versions/max_age_days ({0,0} — off); interval < 0 is a config error,
      0 legal; the policy default goes through domain.ValidateRetention at startup.
    - wire: wireEviction (engine always, runner only when interval > 0 with a live
      remote catalog), App.Eviction/App.EvictionRunner, metrics registration next
      to retention, Stop stage in stopKeepers after retention (60s budget).
    - metrics/eviction.go: retention-analog collector with the eviction prefix
      (runs_total, deleted_keys/bytes, failed_deletes, last_pass_timestamp,
      duration histogram); OnApply fills counters+histogram, OnPass the timestamp.
    - docs/func/ru|EN/config.md: [eviction] section after [retention].
    
    Checked: go build ./..., make vet, make lint (0 issues),
    go test ./internal/core/engine/eviction/ ./internal/core/config/.
    83284d2b