Skip to content

Commit

Permalink
Run all scans once upon start-up.
Browse files Browse the repository at this point in the history
This avoids the need to wait for the periodic jobs to kick in when
implementing bugfixes.
  • Loading branch information
LTLA committed Oct 28, 2024
1 parent 950aba9 commit 0cef285
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func main() {
last_scan := retrieveLastScanTime(last_scan_path)
timer := time.NewTicker(time.Minute * time.Duration(*log_time))
for {
<-timer.C
lock.Lock()
new_last_scan, err := checkLogs(registry, rest_url, to_reignore, to_reregister, last_scan)
lock.Unlock()
Expand All @@ -83,21 +82,22 @@ func main() {
depositLastScanTime(last_scan, last_scan_path)
}
ch_reignore <- true
<-timer.C
}
}()

// Timer to scan the entire registry.
go func() {
timer := time.NewTicker(time.Hour * time.Duration(*full_time))
for {
<-timer.C
lock.Lock()
err := fullScan(registry, rest_url, to_reignore)
lock.Unlock()
if err != nil {
log.Printf("detected failures for log check; %v", err)
}
ch_reignore <- true
<-timer.C
}
}()

Expand Down

0 comments on commit 0cef285

Please sign in to comment.