Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
869bc7a
commit 1e6ccd9
Showing
7 changed files
with
134 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package enlist.grails | ||
|
||
import org.codehaus.groovy.grails.commons.ConfigurationHolder | ||
import enlist.grails.util.DateParser | ||
|
||
|
||
class ActivityReminderJob { | ||
static triggers = { | ||
cron name: 'ActivityReminder', cronExpression: ConfigurationHolder.config.batch.ActivityReminderJob | ||
} | ||
|
||
static final String BATCH_JOB_NAME = "activityReminder" | ||
static final String LAST_ACT_END = "lastActivityReminderDate" | ||
|
||
def activityService | ||
def execute() { | ||
println "run ActivityReminderJob" | ||
BatchJobParameter batchJobParameter = BatchJobParameter.get( BATCH_JOB_NAME, LAST_ACT_END ) | ||
Date lastActReminderDate = activityService.batchSendEmailReminder(batchJobParameter) | ||
if(lastActReminderDate) { | ||
if(!batchJobParameter) batchJobParameter = new BatchJobParameter(batchName: BATCH_JOB_NAME, parameterName: LAST_ACT_END) | ||
batchJobParameter.value = DateParser.printDateTimeDefault(lastActReminderDate) | ||
batchJobParameter.save(failOnError: true, flush: true, validate: false) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package enlist.grails | ||
|
||
import static org.junit.Assert.* | ||
|
||
import grails.test.mixin.* | ||
import grails.test.mixin.support.* | ||
import org.junit.* | ||
|
||
/** | ||
* See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions | ||
*/ | ||
@TestMixin(GrailsUnitTestMixin) | ||
class ActivityReminderJobSpec { | ||
|
||
void setUp() { | ||
// Setup logic here | ||
} | ||
|
||
void tearDown() { | ||
// Tear down logic here | ||
} | ||
|
||
void testSomething() { | ||
fail "Implement me" | ||
} | ||
} |