File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/io/harness/cf/client/example Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 3
3
import com .google .gson .JsonObject ;
4
4
import io .harness .cf .client .api .CfClient ;
5
5
import io .harness .cf .client .api .Config ;
6
+ import io .harness .cf .client .api .FeatureFlagInitializeException ;
6
7
import io .harness .cf .client .api .FileMapStore ;
7
8
import io .harness .cf .client .dto .Target ;
8
9
import java .util .HashMap ;
@@ -58,6 +59,18 @@ public static void main(String... args) {
58
59
.name ("Target_" + random )
59
60
.build ();
60
61
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
+
61
74
scheduler .scheduleAtFixedRate (
62
75
() -> {
63
76
final boolean bResult = client .boolVariation ("flag1" , target , false );
You can’t perform that action at this time.
0 commit comments