我想有定期称为一天一次行动Ø程序,而不需要有在别人登录的。Grails的,拍动作被重复调用,每天一次,每周等
这是可能的,如果它是: 我该怎么做?
这是我的触发:
package com.myproj.jobs
class DailyCheck {
static triggers = {
// cron name: 'dailyCheck', cronExpression: "03 * * * * ?"
simple name: 'myJobSimple', repeatInterval: 6000
}
def dailyCheckService
def execute() {
println(">>>>>>>>> DAILY JOB EXECUTES <<<<<<<")
dailyCheckService.checkOffers()
}
}我的build.gradle的
部分:
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.2.Final"
compile "org.hibernate:hibernate-ehcache:5.1.2.Final"
console "org.grails:grails-console"
compile 'org.grails.plugins:quartz:2.0.12'
profile "org.grails.profiles:web"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.6"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
runtime 'net.sourceforge.jtds:jtds:1.3.1'
compile "ca.redtoad:grails-phonenumbers:0.11"
compile 'org.grails.plugins:spring-security-core:3.1.1'
compile 'org.grails.plugins:spring-security-ui:3.0.0.M2'
compile 'org.grails.plugins:database-migration:3.0.0'
compile 'org.liquibase:liquibase-core:3.5.3'
compile 'org.grails.plugins:rendering:2.0.3'
runtime "org.springframework:spring-test:4.2.1.RELEASE"
compile "org.grails.plugins:excel-export:2.1"
}
对于您正在使用的grails的任何版本,都有一个石英插件 – cfrick
很好,我会检查一下。我正在使用Grails-3.2.3。 – larand