Skip to content

Commit

Permalink
Clean up Besu runtime files when stopping ATs
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 committed Mar 26, 2024
1 parent be24baf commit 6310814
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,21 @@ public void stop() {
nodeRequests.shutdown();
nodeRequests = null;
}

deleteRuntimeFiles();
}

private void deleteRuntimeFiles() {
try {
Files.deleteIfExists(homeDirectory.resolve("besu.networks"));
} catch (IOException e) {
LOG.error("Failed to clean up besu.networks file in {}", homeDirectory, e);
}
try {
Files.deleteIfExists(homeDirectory.resolve("besu.ports"));
} catch (IOException e) {
LOG.error("Failed to clean up besu.ports file in {}", homeDirectory, e);
}
}

@Override
Expand Down

0 comments on commit 6310814

Please sign in to comment.