fixing locks

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@120297 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Lucio Lelii 2015-11-17 17:28:27 +00:00
parent e7d89ededf
commit 6c8da75cd3
1 changed files with 5 additions and 5 deletions

View File

@ -120,7 +120,11 @@ public abstract class AccountingPersistenceBackendFactory {
AccountingPersistenceBackend.class.getSimpleName(), scope, actual.getClass().getSimpleName());
try {
lock.lock();
logger.trace("Renewing Last check Timestamp. The next one will be {}", now);
fallbackLastCheck.put(scope, now);
lastCheckTimestamp = fallbackLastCheck.get(scope);
lock.unlock();
AccountingPersistenceBackend discoveredPersistenceBackend = discoverAccountingPersistenceBackend(scope);
@ -142,10 +146,6 @@ public abstract class AccountingPersistenceBackendFactory {
}
lock.unlock();
return discoveredPersistenceBackend;
}else{
logger.trace("Renewing Last check Timestamp. The next one will be {}", now);
fallbackLastCheck.put(scope, now);
lastCheckTimestamp = fallbackLastCheck.get(scope);
}
}finally {
lock.unlock();