git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@120296 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4445ec9df7
commit
e7d89ededf
|
@ -119,13 +119,12 @@ public abstract class AccountingPersistenceBackendFactory {
|
|||
logger.debug("The {} for scope {} is {}. Is time to rediscover if there is another possibility.",
|
||||
AccountingPersistenceBackend.class.getSimpleName(), scope, actual.getClass().getSimpleName());
|
||||
|
||||
lock.lock();
|
||||
try {
|
||||
logger.trace("Renewing Last check Timestamp. The next one will be {}", now);
|
||||
fallbackLastCheck.put(scope, now);
|
||||
lastCheckTimestamp = fallbackLastCheck.get(scope);
|
||||
|
||||
|
||||
AccountingPersistenceBackend discoveredPersistenceBackend = discoverAccountingPersistenceBackend(scope);
|
||||
|
||||
lock.lock();
|
||||
if(discoveredPersistenceBackend!=null){
|
||||
// Passing the aggregator to the new AccountingPersistenceBackend
|
||||
// so that the buffered records will be persisted with the new method
|
||||
|
@ -143,6 +142,10 @@ 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();
|
||||
|
@ -159,7 +162,7 @@ public abstract class AccountingPersistenceBackendFactory {
|
|||
return actual;
|
||||
}
|
||||
|
||||
protected static synchronized AccountingPersistenceBackend getPersistenceBackend() {
|
||||
protected static AccountingPersistenceBackend getPersistenceBackend() {
|
||||
String scope = ScopeProvider.instance.get();
|
||||
|
||||
if(scope==null){
|
||||
|
|
Loading…
Reference in New Issue