Skip to content
Snippets Groups Projects
Commit b1787289 authored by brinn's avatar brinn
Browse files

fix: retrying logic and warning messages on failure

SVN: 18661
parent 46e01ebc
No related branches found
No related tags found
No related merge requests found
...@@ -84,10 +84,10 @@ public final class FileRenamingCallable implements Callable<Boolean> ...@@ -84,10 +84,10 @@ public final class FileRenamingCallable implements Callable<Boolean>
Unix.setAccessMode(destinationFile.getPath(), permissions); Unix.setAccessMode(destinationFile.getPath(), permissions);
} catch (IOExceptionUnchecked ex) } catch (IOExceptionUnchecked ex)
{ {
// return value does the job operationLog.warn(String.format(
operationLog.warn(String.format("Exception on setting access while moving " "Moving path '%s' to directory '%s' failed (attempt %d).", sourceFile,
+ "path '%s' to directory '%s' (attempt %d).", sourceFile,
destinationFile, ++failures), ex.getCause()); destinationFile, ++failures), ex.getCause());
return null; // Return null to make CallableExecutor try to repeat operation
} }
} }
if (renamed == false) if (renamed == false)
...@@ -95,8 +95,9 @@ public final class FileRenamingCallable implements Callable<Boolean> ...@@ -95,8 +95,9 @@ public final class FileRenamingCallable implements Callable<Boolean>
operationLog.warn(String.format( operationLog.warn(String.format(
"Moving path '%s' to directory '%s' failed (attempt %d).", sourceFile, "Moving path '%s' to directory '%s' failed (attempt %d).", sourceFile,
destinationFile, ++failures)); destinationFile, ++failures));
return null; // Return null to make CallableExecutor try to repeat operation
} }
} }
return renamed; return true;
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment