Changeset 2314 for trunk/eraser
- Timestamp:
- 10/20/2011 4:53:40 AM (19 months ago)
- File:
-
- 1 edited
-
trunk/eraser/Eraser.Manager/Schedule.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.Manager/Schedule.cs
r1802 r2314 431 431 } 432 432 case RecurringScheduleUnit.Monthly: 433 //Step the number of months since the last run 434 if (LastRun != DateTime.MinValue) 435 nextRun = nextRun.AddMonths(frequency); 436 437 //Ensure that the next run day is before the scheduled day of month 438 while (monthlySchedule < nextRun.Day) 439 nextRun = nextRun.AddDays(1); 440 441 //Set the next run date to be the day on which the task will run. 442 nextRun = nextRun.AddDays(-((int)monthlySchedule - nextRun.Day)); 443 while (nextRun < DateTime.Now) 444 nextRun = nextRun.AddMonths(frequency); 433 if (LastRun == DateTime.MinValue) 434 { 435 //Since the schedule has never been used, find the next time 436 //to run the task. If the current day is less than the 437 //scheduled day, leave it alone. Otherwise, go to the 438 //following month. 439 while (monthlySchedule < nextRun.Day) 440 nextRun = nextRun.AddDays(1); 441 } 442 else 443 { 444 //Step the number of months since the last run 445 while (nextRun < DateTime.Now) 446 nextRun = nextRun.AddMonths(frequency); 447 } 448 449 //Set the day of the month which the task is supposed to run. 450 nextRun = nextRun.AddDays(monthlySchedule - nextRun.Day); 445 451 break; 446 452 }
Note: See TracChangeset
for help on using the changeset viewer.
