Changeset 125 for trunk/grails-app/jobs
- Timestamp:
- May 4, 2009, 4:49:22 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/jobs/TaskRecurringScheduleJob.groovy
r123 r125 1 1 2 2 class TaskRecurringScheduleJob { 3 def timeout = 5000 // execute job once in 5 seconds 3 // def timeout = 5000 // execute job once in 5 seconds 4 def timeout = 60000 4 5 5 6 def execute() { 6 println "5" 7 // println "TaskRecurringScheduleJob: tick" 8 // println "TaskRecurringScheduleJob: tock" 7 9 def recurringScheduleInstanceList = RecurringSchedule.list() 8 10 def now = new Date() … … 10 12 recurringScheduleInstanceList.each() { 11 13 12 if ( now <it.nextDueDate) {14 if ( now > it.nextDueDate) { 13 15 def taskInstance = it.task 14 16 def subTaskInstance = new Task() … … 25 27 subTaskInstance.taskType = TaskType.get(1) 26 28 subTaskInstance.leadPerson = taskInstance.leadPerson 27 if(subTaskInstance.save()){println "yes"} 29 subTaskInstance.save() 30 // if(subTaskInstance.save()){println "yes"} 28 31 29 32 //Set the assignedPersons … … 37 40 38 41 //Set the nextDueDate so that we don't loop ;-) 39 // it.nextDueDate = new DateTime(date:2.weeks.from.now) 42 it.nextDueDate = it.nextDueDate + 1 40 43 41 44 }
Note: See TracChangeset
for help on using the changeset viewer.