SetOpLogGCConfig overrides the default sweep interval (1h) and minimum row age (24h). Pass 0 for either to keep the package default. Must be called before StartOpLogGC; calling after the loop has started silently no-ops since the goroutine captured the values at start.
(interval, minAge time.Duration)
| 42 | // loop has started silently no-ops since the goroutine captured the |
| 43 | // values at start. |
| 44 | func (s *Server) SetOpLogGCConfig(interval, minAge time.Duration) { |
| 45 | s.opLogGC.mu.Lock() |
| 46 | defer s.opLogGC.mu.Unlock() |
| 47 | if interval > 0 { |
| 48 | s.opLogGC.interval = interval |
| 49 | } |
| 50 | if minAge > 0 { |
| 51 | s.opLogGC.minAge = minAge |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // StartOpLogGC kicks off the periodic prune-sweep loop. Idempotent — |
| 56 | // calling twice silently no-ops. Must be called AFTER |
no outgoing calls