Skip to content

Commit 96b7fab

Browse files
committed
FFM-1928 - Example extended.
1 parent c7e1b59 commit 96b7fab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/io/harness/cf/client/example/Example.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.gson.JsonObject;
44
import io.harness.cf.client.api.CfClient;
55
import io.harness.cf.client.api.Config;
6+
import io.harness.cf.client.api.FeatureFlagInitializeException;
67
import io.harness.cf.client.api.FileMapStore;
78
import io.harness.cf.client.dto.Target;
89
import java.util.HashMap;
@@ -58,6 +59,18 @@ public static void main(String... args) {
5859
.name("Target_" + random)
5960
.build();
6061

62+
try {
63+
64+
client.waitForInitialization();
65+
66+
} catch (InterruptedException | FeatureFlagInitializeException e) {
67+
68+
log.error(e.getMessage());
69+
System.exit(1);
70+
}
71+
72+
log.info("Client is ready: " + keyName + ", " + client.hashCode());
73+
6174
scheduler.scheduleAtFixedRate(
6275
() -> {
6376
final boolean bResult = client.boolVariation("flag1", target, false);

0 commit comments

Comments
 (0)