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() {
log.debug("Starting lease cleanup thread.");
isRunning = true;
completedLeaseStopwatch.start();
garbageLeaseStopwatch.start();
if (!isRunning) {
completedLeaseStopwatch.start();
garbageLeaseStopwatch.start();
}
deletionThreadPool.scheduleAtFixedRate(new LeaseCleanupThread(), INITIAL_DELAY, leaseCleanupIntervalMillis,
TimeUnit.MILLISECONDS);
isRunning = true;
}
/**