entitlement: Fix issue with optimized call getBlockingActiveForAccount. See
We need to also check if any 'active' blocking states were returned to avoid pulling again all the subscriptions/bundles/events if no active blocking states
@@ -243,7 +243,8 @@ public class ProxyBlockingStateDao implements BlockingStateDao {
@Override
public List<BlockingState> getBlockingActiveForAccount(final VersionedCatalog catalog, @Nullable final LocalDate cutoffDt, final InternalTenantContext context) {
final List<BlockingState> statesOnDisk = delegate.getBlockingActiveForAccount(catalog, cutoffDt, context);
- return addBlockingStatesNotOnDisk(statesOnDisk, catalog, cutoffDt, context);
+ final List<BlockingState> result = (statesOnDisk.size() > 0) ? addBlockingStatesNotOnDisk(statesOnDisk, catalog, cutoffDt, context) : statesOnDisk;
+ return result;
}
@Override
