File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
x-pack/plugin/core/src/main/java/org/elasticsearch/license Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 3333 */
3434public class XPackLicenseState {
3535
36- /**
37- * For features that are used at high frequency (e.g. per-search or per-document, etc.), we don't want to bother updating
38- * the 'last used' timestamp more often than some minimum frequency.
39- */
40- private static final long FEATURE_USAGE_MINIMUM_ELAPSED_TIME_MILLIS = TimeValue .timeValueSeconds (10 ).getMillis ();
41-
4236 /** Messages for each feature which are printed when the license expires. */
4337 static final Map <String , String []> EXPIRATION_MESSAGES ;
4438 static {
@@ -453,11 +447,11 @@ public String statusDescription() {
453447
454448 void featureUsed (LicensedFeature feature ) {
455449 checkExpiry ();
456- // if at least the minimum elapsed time has passed, then update the most recently used time for this feature
450+ // update the most recent usage time, but only if isn't already present or has increased
457451 final FeatureUsage feat = new FeatureUsage (feature , null );
458- final long now = epochMillisProvider .getAsLong ();
459452 final Long mostRecent = usage .get (feat );
460- if (mostRecent == null || now - mostRecent >= FEATURE_USAGE_MINIMUM_ELAPSED_TIME_MILLIS ) {
453+ final long now = epochMillisProvider .getAsLong ();
454+ if (mostRecent == null || now > mostRecent ) {
461455 usage .put (feat , now );
462456 }
463457 }
You can’t perform that action at this time.
0 commit comments