Adding safety check around stopwatches

This commit is contained in:
Joshua Kim 2020-07-27 18:08:35 -04:00
parent 5470bc7488
commit 5a0a6c600e

View file

@ -82,12 +82,15 @@ public class LeaseCleanupManager {
*/ */
public void start() { public void start() {
log.debug("Starting lease cleanup thread."); log.debug("Starting lease cleanup thread.");
isRunning = true;
completedLeaseStopwatch.start(); if (!isRunning) {
garbageLeaseStopwatch.start(); completedLeaseStopwatch.start();
garbageLeaseStopwatch.start();
}
deletionThreadPool.scheduleAtFixedRate(new LeaseCleanupThread(), INITIAL_DELAY, leaseCleanupIntervalMillis, deletionThreadPool.scheduleAtFixedRate(new LeaseCleanupThread(), INITIAL_DELAY, leaseCleanupIntervalMillis,
TimeUnit.MILLISECONDS); TimeUnit.MILLISECONDS);
isRunning = true;
} }
/** /**