Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,7 @@ private record VersionedApiKeyDoc(ApiKeyDoc doc, String id, long seqNo, long pri

private RemovalListener<String, ListenableFuture<CachedApiKeyHashResult>> getAuthCacheRemovalListener(int maximumWeight) {
return notification -> {
if (RemovalReason.EVICTED == notification.getRemovalReason() && getApiKeyAuthCache().count() >= maximumWeight) {
if (RemovalReason.EVICTED == notification.getRemovalReason() && getApiKeyAuthCache().weight() >= maximumWeight) {
evictionCounter.increment();
logger.trace(
"API key with ID [{}] was evicted from the authentication cache, " + "possibly due to cache size limit",
Expand Down