Fixing code to support retry
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@120323 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b316a78e8e
commit
440d1ae001
|
@ -79,12 +79,14 @@ public class AccountingPersistenceBackendMonitor implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(elaborationFile!=null){
|
if(elaborationFile!=null){
|
||||||
elaborateFile(elaborationFile);
|
synchronized (elaborationFile) {
|
||||||
boolean deleted = elaborationFile.delete();
|
elaborateFile(elaborationFile);
|
||||||
if(!deleted){
|
boolean deleted = elaborationFile.delete();
|
||||||
logger.debug("Failed to delete file {}", elaborationFile.getAbsolutePath());
|
if(!deleted){
|
||||||
File elaborationFileNotDeleted = new File(elaborationFile.getAbsolutePath()+ELABORATION_FILE_NOT_DELETED_SUFFIX);
|
logger.debug("Failed to delete file {}", elaborationFile.getAbsolutePath());
|
||||||
elaborationFile.renameTo(elaborationFileNotDeleted);
|
File elaborationFileNotDeleted = new File(elaborationFile.getAbsolutePath()+ELABORATION_FILE_NOT_DELETED_SUFFIX);
|
||||||
|
elaborationFile.renameTo(elaborationFileNotDeleted);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue