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)
| 186 | // grace period (30d). Pass 0 for either to keep the package default. |
| 187 | // Must be called before StartOrphanGC. |
| 188 | func (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 |
no outgoing calls