Only write once file if run was 100% successful
Otherwise, if a single log was unreachable, we'd be force to download all of it on the next run.
This commit is contained in:
parent
0d9b81ecc8
commit
c8f0a0f9e8
|
@ -326,10 +326,12 @@ func Main(statePath string, processCallback certspotter.ProcessCallback) int {
|
|||
exitCode |= processLog(&logs[i], processCallback)
|
||||
}
|
||||
|
||||
if state.IsFirstRun() && exitCode == 0 {
|
||||
if err := state.Finish(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s: Error finalizing state: %s\n", os.Args[0], err)
|
||||
exitCode |= 1
|
||||
}
|
||||
}
|
||||
|
||||
return exitCode
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue