MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / SetOrphanGCConfig

Method SetOrphanGCConfig

internal/server/orphan_gc.go:188–197  ·  view source on GitHub ↗

SetOrphanGCConfig overrides the default sweep interval (24h) and grace period (30d). Pass 0 for either to keep the package default. Must be called before StartOrphanGC.

(interval, grace time.Duration)

Source from the content-addressed store, hash-verified

186// grace period (30d). Pass 0 for either to keep the package default.
187// Must be called before StartOrphanGC.
188func (s *Server) SetOrphanGCConfig(interval, grace time.Duration) {
189 s.orphanGC.mu.Lock()
190 defer s.orphanGC.mu.Unlock()
191 if interval > 0 {
192 s.orphanGC.interval = interval
193 }
194 if grace > 0 {
195 s.orphanGC.grace = grace
196 }
197}
198
199// StartOrphanGC kicks off the periodic sweep loop. Idempotent —
200// calling twice is a no-op (existing loop continues, second call

Callers 2

TestOrphanGC_StartStopFunction · 0.80
serveCmdFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestOrphanGC_StartStopFunction · 0.64