MCPcopy
hub / github.com/cloudflare/cloudflared / ScheduleCleanup

Method ScheduleCleanup

packet/funnel.go:76–88  ·  view source on GitHub ↗
(ctx context.Context, idleTimeout time.Duration)

Source from the content-addressed store, hash-verified

74}
75
76func (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
90func (ft *FunnelTracker) cleanup(idleTimeout time.Duration) {
91 ft.lock.Lock()

Callers 2

ServeMethod · 0.80
ServeMethod · 0.80

Calls 2

cleanupMethod · 0.95
StopMethod · 0.45

Tested by

no test coverage detected