Skip to content

Commit

Permalink
Switch to FileSystemUtils.deleteRecursively for job folder cleanup
Browse files Browse the repository at this point in the history
Using 'Files.deleteIfExists(path)' may fail depending on traversal order, as it may delete a non-empty directory.
  • Loading branch information
mprimi committed May 22, 2019
1 parent 9bbff8b commit 9d7cb6b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ private void cleanupJobDirectory(
.forEach(path -> {
try {
log.debug("Deleting {}", path);
Files.deleteIfExists(path);
FileSystemUtils.deleteRecursively(path);
} catch (final IOException e) {
log.warn("Failed to delete: {}", path.toAbsolutePath().toString(), e);
}
Expand Down

0 comments on commit 9d7cb6b

Please sign in to comment.