Skip to content

Commit

Permalink
Avoid unnecessary writes to the timestamp file if it hasn't changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Oct 22, 2024
1 parent 5939d95 commit db2f85c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ func main() {
if err != nil {
log.Printf("detected failures for log check; %v", err)
}
last_scan = new_last_scan // this can be set regardless of 'err'.
depositLastScanTime(last_scan, last_scan_path)
if last_scan != new_last_scan { // new_last_scan can be used regardless of 'err'.
last_scan = new_last_scan
depositLastScanTime(last_scan, last_scan_path)
}
ch_reignore <- true
}
}()
Expand Down

0 comments on commit db2f85c

Please sign in to comment.