Mantis - Resin
Viewing Issue Advanced Details
3736 minor always 11-02-09 09:57 02-18-10 12:10
alex  
ferg  
normal  
closed 3.1.9  
fixed  
none    
none 4.0.4  
0003736: broken ScheduledTask
rep by: tweihs on [resin-interest]

Here's the config we have:

   <scheduled-task type="mm.services.DownloadService"
name="DownloadService">
       <cron>3,7,15,20,25,30,35,40,45,50,54,58 * * * *</cron>
   </scheduled-task>

Running this today (Nov 1), the next start time is set to Nov 8. I set
resin's debug level to finer, and all scheduled tasks now start a week late.

Although I have "*" in the day of week block, CronType is advancing the next
time to current day + 7. There was one change made to CronType between
3.1.8 and 3.1.9, which is highlighted below. 3.1.8 does not push the next
start time out a week.

if (_daysOfWeek != null) {
    int oldDayOfWeek = cal.getDayOfWeek() - 1;
    int dayOfWeek = nextInterval(_daysOfWeek, oldDayOfWeek);

if (dayOfWeek > 0) {
      day += (dayOfWeek - oldDayOfWeek);
    }
    else {
      dayOfWeek = nextInterval(_daysOfWeek, 0);
      
      day += (dayOfWeek - oldDayOfWeek + 7);
    }

Notes
(0004441)
ferg   
02-18-10 12:10   
server/2i49