Method
ScheduleCleanup
(ctx context.Context, idleTimeout time.Duration)
Source from the content-addressed store, hash-verified
| 74 | } |
| 75 | |
| 76 | func (ft *FunnelTracker) ScheduleCleanup(ctx context.Context, idleTimeout time.Duration) { |
| 77 | checkIdleTicker := time.NewTicker(idleTimeout) |
| 78 | defer checkIdleTicker.Stop() |
| 79 | |
| 80 | for { |
| 81 | select { |
| 82 | case <-ctx.Done(): |
| 83 | return |
| 84 | case <-checkIdleTicker.C: |
| 85 | ft.cleanup(idleTimeout) |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | func (ft *FunnelTracker) cleanup(idleTimeout time.Duration) { |
| 91 | ft.lock.Lock() |
Tested by
no test coverage detected