Skip to content

Commit

Permalink
Marks DCF as initialized in the constructor
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Sep 13, 2023
1 parent 1e4afc8 commit 90f7453
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -125,7 +124,6 @@ public final static SecurityDynamicConfiguration<?> addStatics(SecurityDynamicCo

protected final Logger log = LogManager.getLogger(this.getClass());
private final ConfigurationRepository cr;
private final AtomicBoolean initialized = new AtomicBoolean();
private final EventBus eventBus = EVENT_BUS_BUILDER.logger(new JavaLogger(DynamicConfigFactory.class.getCanonicalName())).build();
private final Settings opensearchSettings;
private final Path configPath;
Expand Down Expand Up @@ -160,6 +158,7 @@ public DynamicConfigFactory(

registerDCFListener(this.iab);
this.cr.subscribeOnChange(this);
initializationLatch.countDown();
}

@Override
Expand Down Expand Up @@ -314,7 +313,6 @@ public void onChange(Map<CType, SecurityDynamicConfiguration<?>> typeToConfig) {
eventBus.post(audit);
}

initialized.set(true);
initializationLatch.countDown();
}

Expand All @@ -333,7 +331,6 @@ private static ConfigV7 getConfigV7(SecurityDynamicConfiguration<?> sdc) {
public void waitForInit() throws InterruptedException {
// wait for DCF to completely initialized
initializationLatch.await();

}

public void registerDCFListener(Object listener) {
Expand Down

0 comments on commit 90f7453

Please sign in to comment.