MCPcopy Create free account
hub / github.com/ethstorage/es-node / launchScanLoop

Method launchScanLoop

ethstorage/scanner/scanner.go:122–141  ·  view source on GitHub ↗
(rt *scanLoopRuntime)

Source from the content-addressed store, hash-verified

120}
121
122func (s *Scanner) launchScanLoop(rt *scanLoopRuntime) {
123 s.wg.Add(1)
124 go func() {
125 defer s.wg.Done()
126 s.lg.Info("Launching scanner loop", "mode", rt.mode, "interval", rt.interval, "batchSize", rt.batchSize)
127 mainTicker := time.NewTicker(rt.interval)
128 defer mainTicker.Stop()
129
130 s.doScan(rt)
131 for {
132 select {
133 case <-mainTicker.C:
134 s.doScan(rt)
135
136 case <-s.ctx.Done():
137 return
138 }
139 }
140 }()
141}
142
143func (s *Scanner) doScan(state *scanLoopRuntime) {
144 if !s.acquireScanPermit() {

Callers 1

startMethod · 0.95

Calls 2

doScanMethod · 0.95
StopMethod · 0.45

Tested by

no test coverage detected