Skip to content

Commit

Permalink
Remove storage dir in case of processExitError
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Jun 16, 2021
1 parent ed5e878 commit 3d28e9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ingest/ledgerbackend/stellar_core_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,11 @@ func (r *stellarCoreRunner) close() error {
r.pipe.Reader.Close()
}

if runtime.GOOS == "windows" {
if runtime.GOOS == "windows" || r.processExitError != nil {
// It's impossible to send SIGINT on Windows so buckets can become
// corrupted. If we can't reuse it, then remove it.
// We also remove the storage path if there was an error terminating the
// process (files can be corrupted).
return os.RemoveAll(storagePath)
}

Expand Down

0 comments on commit 3d28e9e

Please sign in to comment.