Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
Here is the piece of code I doubt
public void run(){ if (isRunning){ return; } now = System.currentTimeMillis(); // clean history only once a day at max if (lastRan ==0 || (now - lastRan) < ONE_DAY_IN_MS){ return; } lastRan = now; ..... // main code for cleaning }
lastRun is initialized to 0 and hence HistoryCleaner will never execute the main code. Also a testcase should be written for JobHistory.HistoryCleaner to check if it works as expected.