From 730763fa3011534b7929699df9b82ce6316315d9 Mon Sep 17 00:00:00 2001 From: shawkins Date: Wed, 28 Apr 2021 14:03:11 -0400 Subject: [PATCH] switching to not even track the future to pass sonar check --- .../kubernetes/client/informers/cache/Controller.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/cache/Controller.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/cache/Controller.java index d7293155cdf..9338b7a3204 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/cache/Controller.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/cache/Controller.java @@ -63,8 +63,6 @@ public class Controller eventListeners; @@ -97,7 +95,7 @@ public void run() { if (fullResyncPeriod > 0) { ResyncRunnable resyncRunnable = new ResyncRunnable(queue, resyncFunc); if(!resyncExecutor.isShutdown()) { - resyncFuture = resyncExecutor.scheduleAtFixedRate(resyncRunnable, fullResyncPeriod, fullResyncPeriod, TimeUnit.MILLISECONDS); + resyncExecutor.scheduleAtFixedRate(resyncRunnable, fullResyncPeriod, fullResyncPeriod, TimeUnit.MILLISECONDS); } } else { log.info("informer#Controller: resync skipped due to 0 full resync period"); @@ -123,10 +121,7 @@ public void run() { */ public void stop() { reflector.stop(); - if (resyncFuture != null) { - resyncFuture.cancel(true); - } - resyncExecutor.shutdown(); + resyncExecutor.shutdownNow(); } /**