()
| 94 | } |
| 95 | |
| 96 | func (s *Scanner) start() { |
| 97 | s.mu.Lock() |
| 98 | if s.running { |
| 99 | s.mu.Unlock() |
| 100 | return |
| 101 | } |
| 102 | s.running = true |
| 103 | s.mu.Unlock() |
| 104 | |
| 105 | if s.cfg.Mode&modeSetMeta != 0 { |
| 106 | s.launchScanLoop(s.metaScanLoopRuntime()) |
| 107 | } |
| 108 | if s.cfg.Mode&modeSetBlob != 0 { |
| 109 | s.launchScanLoop(s.blobScanLoopRuntime()) |
| 110 | } |
| 111 | if s.cfg.Mode&modeSetBlock != 0 { |
| 112 | s.launchScanLoop(s.blockScanLoopRuntime()) |
| 113 | } |
| 114 | |
| 115 | s.lg.Info("Scanner started", "mode", s.cfg.Mode.String()) |
| 116 | |
| 117 | s.startReporter() |
| 118 | |
| 119 | s.launchFixLoop(time.Minute * fixingInterval) |
| 120 | } |
| 121 | |
| 122 | func (s *Scanner) launchScanLoop(rt *scanLoopRuntime) { |
| 123 | s.wg.Add(1) |
no test coverage detected