Changeset 125 for trunk/grails-app/jobs


Ignore:
Timestamp:
May 4, 2009, 4:49:22 PM (15 years ago)
Author:
gav
Message:

Detail Inventory and associated, update BootStrap? and some work on TaskRecurringScheduleJob?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/jobs/TaskRecurringScheduleJob.groovy

    r123 r125  
    11
    22class 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
    45
    56    def execute() {
    6         println "5"
     7//         println "TaskRecurringScheduleJob: tick"
     8//         println "TaskRecurringScheduleJob: tock"
    79        def recurringScheduleInstanceList = RecurringSchedule.list()
    810        def now = new Date()
     
    1012        recurringScheduleInstanceList.each() {
    1113
    12             if ( now < it.nextDueDate) {
     14            if ( now > it.nextDueDate) {
    1315                def taskInstance = it.task
    1416                def subTaskInstance = new Task()
     
    2527                subTaskInstance.taskType = TaskType.get(1)
    2628                subTaskInstance.leadPerson = taskInstance.leadPerson
    27                 if(subTaskInstance.save()){println "yes"}
     29                subTaskInstance.save()
     30//                 if(subTaskInstance.save()){println "yes"}
    2831   
    2932                //Set the assignedPersons
     
    3740
    3841                //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
    4043   
    4144            }
Note: See TracChangeset for help on using the changeset viewer.