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() {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue