forked from cwhd/measurementor
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a bunch of changes and some clean up
- Loading branch information
cdav18
committed
Jan 9, 2015
1 parent
f3ed294
commit 850f4a0
Showing
10 changed files
with
320 additions
and
224 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
*.iml | ||
.idea | ||
/target | ||
.gradle | ||
/target | ||
/buildPlugins | ||
/build | ||
application.properties |
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,38 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath "org.grails:grails-gradle-plugin:2.1.0" | ||
} | ||
} | ||
apply plugin: 'grails' | ||
|
||
grails { | ||
grailsVersion = '2.4.3' // Specifies the Grails version to use | ||
groovyVersion = '2.3.6' // Specify the Groovy version to use (should match the version that ships with the above Grails version) | ||
springLoadedVersion = '1.2.0.RELEASE' // Specify the Spring Loaded version to use | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
grails.central() //Adds the Grails Central Repository for resolving Grails plugins (replaces grailsPlugins(), grailsCentral() from BuildConfig.groovy) | ||
} | ||
|
||
dependencies { | ||
bootstrap 'org.grails.plugins:tomcat:7.0.50.1' | ||
|
||
compile 'org.grails.plugins:scaffolding:2.0.2' | ||
compile 'org.grails.plugins:cache:1.1.1' | ||
|
||
runtime 'org.grails.plugins:hibernate:3.6.10.8' //or 'org.grails.plugins:hibernate4:4.3.1.1' | ||
runtime 'org.grails.plugins:database-migration:1.3.8' | ||
runtime 'org.grails.plugins:jquery:1.11.0' | ||
runtime 'org.grails.plugins:resources:1.2.2' | ||
|
||
compile 'org.grails.plugins:rest:0.8' | ||
compile 'org.grails.plugins:mongodb:3.0.2' | ||
compile 'org.grails.plugins:quartz:1.0.2' | ||
compile 'org.grails.plugins:elasticsearch:0.0.3.6' | ||
|
||
} |
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 |
---|---|---|
@@ -1,46 +1,23 @@ | ||
package org.cwhd.measure | ||
|
||
import org.cwhd.measure.system.JobHistory | ||
|
||
import java.util.concurrent.TimeUnit | ||
|
||
import org.apache.commons.logging.LogFactory | ||
/** | ||
* the main job that calls all the services to get data. note that history | ||
* is stored in mongo along with everything else | ||
*/ | ||
class PopulatorJob { | ||
def jiraDataService | ||
def stashDataService | ||
private static final logger = LogFactory.getLog(this) | ||
def updateDataFromSourceService | ||
|
||
static triggers = { | ||
simple startDelay: 5000l, repeatCount:0 | ||
//wait an hour to start, repeat every 8 hours | ||
simple startDelay: 3600000, repeatInterval: 28800000, repeatCount:-1 | ||
} | ||
|
||
//TODO this would be best if i can pass in the last date this ran... | ||
//if i have that date, then query for all changes since last run | ||
//if i don't have it get everything! | ||
def execute() { | ||
|
||
/* | ||
def result = "unknown" | ||
try { | ||
def startDateTime = new Date() | ||
jiraDataService.getData(0, 100, "ACOE") | ||
stashDataService.getAll() | ||
def doneDateTime = new Date() | ||
def difference = doneDateTime.getTime() - startDateTime.getTime() | ||
def minutesDiff = TimeUnit.MILLISECONDS.toMinutes(difference) | ||
result = "success in $difference ms" | ||
println "---------------------------------------------------" | ||
println "ALL DONE IN ~$minutesDiff minutes" | ||
println "---------------------------------------------------" | ||
} catch (Exception ex) { | ||
result = "FAIL: $ex.message" | ||
} | ||
JobHistory history = new JobHistory(jobDate: new Date(), jobResult: result) | ||
history.save(failOnError: true) | ||
*/ | ||
logger.info("----------------------------------") | ||
logger.info("STARTING TIMED JOB") | ||
logger.info("----------------------------------") | ||
updateDataFromSourceService.getAllData() | ||
} | ||
} | ||
} |
Oops, something went wrong.