From 6284db3a4d8503d068e450eceb3688080be7992a Mon Sep 17 00:00:00 2001 From: Jay Modi Date: Wed, 12 Oct 2016 08:04:49 -0400 Subject: [PATCH] security: use correct time unit for role cache expire after write The role cache was previously using the wrong time unit for its expire after write time; the value passed to the cache was milliseconds instead of nanoseconds. Original commit: elastic/x-pack-elasticsearch@65f7b087636a1d456b1595d3ada9b6e4446edb9c --- .../xpack/security/authz/store/NativeRolesStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java index 1d25ffaf8c0..c4964ce7506 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java @@ -135,7 +135,7 @@ public class NativeRolesStore extends AbstractComponent implements RolesStore, C this.client = client; this.roleCache = CacheBuilder.builder() .setMaximumWeight(CACHE_SIZE_SETTING.get(settings)) - .setExpireAfterWrite(CACHE_TTL_SETTING.get(settings).getMillis()) + .setExpireAfterWrite(CACHE_TTL_SETTING.get(settings).getNanos()) .build(); this.isTribeNode = settings.getGroups("tribe", true).isEmpty() == false; }