Skip to content

Commit 8cdfd14

Browse files
mjmbischoffjbaiera
authored andcommitted
weight() vs count() in ApiKeyService.java (elastic#131777)
use weight() vs count()
1 parent ae90da4 commit 8cdfd14

File tree

1 file changed

+1
-1
lines changed
  • x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc

1 file changed

+1
-1
lines changed

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2342,7 +2342,7 @@ private record VersionedApiKeyDoc(ApiKeyDoc doc, String id, long seqNo, long pri
23422342

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

0 commit comments

Comments
 (0)