minor fix

Original commit: elastic/x-pack-elasticsearch@9552d8fbb1
This commit is contained in:
Areek Zillur 2014-10-17 10:58:24 -04:00
parent 0b72572711
commit 8367fc43d5
1 changed files with 4 additions and 0 deletions

View File

@ -453,12 +453,16 @@ public class LicensesService extends AbstractLifecycleComponent<LicensesService>
private void enableFeatureIfNeeded() {
if (toggle.compareAndSet(false, true) || initialState.compareAndSet(true, false)) {
listener.onEnabled();
// needed as toggle may not be set
toggle.set(true);
}
}
private void disableFeatureIfNeeded() {
if (toggle.compareAndSet(true, false) || initialState.compareAndSet(true, false)) {
listener.onDisabled();
// needed as toggle may not be set
toggle.set(false);
}
}
}