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:
Luca Frosini 2015-11-19 15:07:12 +00:00
parent b316a78e8e
commit 440d1ae001
1 changed files with 8 additions and 6 deletions

View File

@ -79,6 +79,7 @@ public class AccountingPersistenceBackendMonitor implements Runnable {
} }
if(elaborationFile!=null){ if(elaborationFile!=null){
synchronized (elaborationFile) {
elaborateFile(elaborationFile); elaborateFile(elaborationFile);
boolean deleted = elaborationFile.delete(); boolean deleted = elaborationFile.delete();
if(!deleted){ if(!deleted){
@ -86,6 +87,7 @@ public class AccountingPersistenceBackendMonitor implements Runnable {
File elaborationFileNotDeleted = new File(elaborationFile.getAbsolutePath()+ELABORATION_FILE_NOT_DELETED_SUFFIX); File elaborationFileNotDeleted = new File(elaborationFile.getAbsolutePath()+ELABORATION_FILE_NOT_DELETED_SUFFIX);
elaborationFile.renameTo(elaborationFileNotDeleted); elaborationFile.renameTo(elaborationFileNotDeleted);
} }
}
} }