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,9 +326,11 @@ func Main(statePath string, processCallback certspotter.ProcessCallback) int {
|
||||||
exitCode |= processLog(&logs[i], processCallback)
|
exitCode |= processLog(&logs[i], processCallback)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := state.Finish(); err != nil {
|
if state.IsFirstRun() && exitCode == 0 {
|
||||||
fmt.Fprintf(os.Stderr, "%s: Error finalizing state: %s\n", os.Args[0], err)
|
if err := state.Finish(); err != nil {
|
||||||
exitCode |= 1
|
fmt.Fprintf(os.Stderr, "%s: Error finalizing state: %s\n", os.Args[0], err)
|
||||||
|
exitCode |= 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return exitCode
|
return exitCode
|
||||||
|
|
Loading…
Reference in New Issue