Changeset 434


Ignore:
Timestamp:
Mar 7, 2010, 5:03:17 PM (10 years ago)
Author:
gav
Message:

Small fix to prevent recurring schedule generating errors before base data has been created.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/TaskRecurringScheduleService.groovy

    r243 r434  
    33    boolean transactional = false
    44
     5    // Can hold state since the service is a singleton.
     6    boolean baseDataWarnLogged = false
     7
     8    def taskService
    59    def dateUtilService
    6     def taskService
     10    def appConfigService
    711
    812    /**
     
    1317        def taskRecurringScheduleList = TaskRecurringSchedule.findAllByEnabled(true)
    1418
     19        // Prevent errors if base data has not yet been created.
     20        if(!appConfigService.exists("baseDataCreated")) {
     21            if(!baseDataWarnLogged) {
     22                log.warn "Base data has not been created, can't generate all."
     23                baseDataWarnLogged = true
     24            }
     25            return
     26        }
     27
    1528        taskRecurringScheduleList.each() {
    1629
    17             if ( dateUtilService.tomorrow > it.nextGenerationDate) {
     30            if (dateUtilService.tomorrow > it.nextGenerationDate) {
    1831                    def p = [:]
    1932
Note: See TracChangeset for help on using the changeset viewer.