feat(scanner): added option to scan at startup

closes #251
This commit is contained in:
Brian Doherty
2022-11-05 11:20:01 -05:00
committed by sentriz
parent 85cb0feb5a
commit f6c95503c7
3 changed files with 27 additions and 16 deletions

View File

@@ -344,6 +344,12 @@ func (s *Server) StartScanTicker(dur time.Duration) (FuncExecute, FuncInterrupt)
}
}
func (s *Server) ScanAtStart() {
if _, err := s.scanner.ScanAndClean(scanner.ScanOptions{}); err != nil {
log.Printf("error scanning: %v", err)
}
}
func (s *Server) StartScanWatcher() (FuncExecute, FuncInterrupt) {
return func() error {
log.Printf("starting job 'scan watcher'\n")