Skip to content

Commit

Permalink
switching to not even track the future to pass sonar check
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Apr 28, 2021
1 parent 18542b2 commit 730763f
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ public class Controller<T extends HasMetadata, L extends KubernetesResourceList<

private final ScheduledExecutorService resyncExecutor;

private volatile ScheduledFuture resyncFuture;

private final OperationContext operationContext;

private final ConcurrentLinkedQueue<SharedInformerEventListener> eventListeners;
Expand Down Expand Up @@ -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");
Expand All @@ -123,10 +121,7 @@ public void run() {
*/
public void stop() {
reflector.stop();
if (resyncFuture != null) {
resyncFuture.cancel(true);
}
resyncExecutor.shutdown();
resyncExecutor.shutdownNow();
}

/**
Expand Down

0 comments on commit 730763f

Please sign in to comment.