Skip to content

Commit

Permalink
Fix feature flag listener
Browse files Browse the repository at this point in the history
- retrieve `useDynamicConfig` toggle from correct location in feat-flag.json file
  • Loading branch information
BehnamMozafari committed Feb 4, 2025
1 parent 63b0c4b commit c831e25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/uid2/operator/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,12 @@ private void run() throws Exception {
private void setupFeatureFlagListener(ConfigServiceManager manager, ConfigRetriever retriever) {
retriever.listen(change -> {
JsonObject newConfig = change.getNewConfiguration();
boolean useDynamicConfig = newConfig.getBoolean(Const.Config.RemoteConfigFeatureFlagProp, true);
boolean useDynamicConfig = newConfig.getJsonObject("remote_config").getBoolean("enabled", true);
manager.updateConfigService(useDynamicConfig).onComplete(update -> {
if (update.succeeded()) {
LOGGER.info("Remote config feature flag toggled successfully");
} else {
LOGGER.error("Failed to toggle remote config feature flag: " + update.cause());
LOGGER.error("Failed to toggle remote config feature flag: ", update.cause());
}
});
});
Expand Down

0 comments on commit c831e25

Please sign in to comment.