88import java .util .concurrent .ScheduledExecutorService ;
99import java .util .concurrent .TimeUnit ;
1010
11- import static com .github .switcherapi .playground .Features .MY_SWITCHER ;
11+ import static com .github .switcherapi .playground .Features .CLIENT_JAVA_FEATURE ;
1212import static com .github .switcherapi .playground .Features .getSwitcher ;
1313
1414public class ClientPlayground {
@@ -19,14 +19,18 @@ public class ClientPlayground {
1919
2020 public static void test () {
2121 new Features ().configureClient ();
22- Switcher switcher = getSwitcher (MY_SWITCHER )
22+ Switcher switcher = getSwitcher (CLIENT_JAVA_FEATURE )
2323 .bypassMetrics ()
2424 .build ();
2525
2626 scheduler .scheduleAtFixedRate (() -> {
27- long time = System .currentTimeMillis ();
28- logger .info ("Switcher is on: {}" , switcher .isItOn ());
29- logger .info ("Time elapsed: {}" , System .currentTimeMillis () - time );
27+ try {
28+ long time = System .currentTimeMillis ();
29+ logger .info ("Switcher is on: {}" , switcher .isItOn ());
30+ logger .info ("Time elapsed: {}" , System .currentTimeMillis () - time );
31+ } catch (Exception e ) {
32+ logger .error (e .getMessage (), e );
33+ }
3034 }, 0 , 5 , TimeUnit .SECONDS );
3135 }
3236
0 commit comments