Skip to content

Commit

Permalink
[JENKINS-24824] Log deletion failure
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergondza committed Jan 26, 2015
1 parent ab81960 commit e151b89
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main/java/hudson/plugins/ws_cleanup/Wipeout.java
Expand Up @@ -60,16 +60,23 @@ protected void perform(FilePath workspace) throws IOException, InterruptedExcept
"Cleaning workspace synchronously. Failed to rename {0} to {1}.",
new Object[] { workspace.getRemote(), deleteMe.getName() }
);
workspace.act(COMMAND);
workspace.deleteRecursive();
}

deleteMe.actAsync(COMMAND);
}

private final static Command COMMAND = new Command();
private final static class Command implements FileCallable<Object> {
public Object invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
Util.deleteRecursive(f);
private final static class Command implements FileCallable<Void> {
public Void invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
try {
Util.deleteRecursive(f);
} catch (IOException ex) {
LOGGER.log(Level.SEVERE, "Unable to delete workspace", ex);
}
if (f.exists()) {
LOGGER.log(Level.SEVERE, "Workspace not deleted successfully: " + f.getAbsolutePath());
}
return null;
}
}
Expand Down

0 comments on commit e151b89

Please sign in to comment.