Adding safety check around stopwatches
This commit is contained in:
parent
5470bc7488
commit
5a0a6c600e
1 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue