Pull request #78: RED-4515: Fixed wrong logic in removallistener of client caches
Merge in RED/search-service from RED-4515 to master * commit '487f6c31903da3de22e420b308987d8edb186231': RED-4515: Fixed wrong logic in removallistener of client caches
This commit is contained in:
commit
0471b7f52c
@ -54,11 +54,11 @@ public class EsClientCache {
|
||||
numberOfUsersForSameClient++;
|
||||
}
|
||||
}
|
||||
if(numberOfUsersForSameClient <= 1){
|
||||
if(numberOfUsersForSameClient == 0){
|
||||
clientToRemove.shutdown();
|
||||
log.info("Closed elasticsearch client for tenant {}", removal.getKey());
|
||||
} else {
|
||||
log.info("Keeping client open from {} because it is still used by {} other tenants", removal.getKey(), numberOfUsersForSameClient - 1);
|
||||
log.info("Keeping client open from {} because it is still used by {} other tenants", removal.getKey(), numberOfUsersForSameClient);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
@ -54,11 +54,11 @@ public class OpensearchClientCache {
|
||||
numberOfUsersForSameClient++;
|
||||
}
|
||||
}
|
||||
if(numberOfUsersForSameClient <= 1){
|
||||
if(numberOfUsersForSameClient == 0){
|
||||
clientToRemove.shutdown();
|
||||
log.info("Closed elasticsearch client for tenant {}", removal.getKey());
|
||||
} else {
|
||||
log.info("Keeping client open from {} because it is still used by {} other tenants", removal.getKey(), numberOfUsersForSameClient - 1);
|
||||
log.info("Keeping client open from {} because it is still used by {} other tenants", removal.getKey(), numberOfUsersForSameClient);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user