Je veux avoir une procédure d'o action appelée périodiquement une fois par jour sans qu'il soit nécessaire d'avoir quelqu'un connecté.Grails, faire une action appelée à plusieurs reprises une fois par jour, semaine, etc
Est-ce possible et si elle est : Comment puis-je le faire?
Ceci est mon Trigger:
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()
}
}
Une partie de mon 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"
}
Il y a un plugin à quartz pour n'importe quelle version de grails que vous utilisez – cfrick
Fine Je vais vérifier cela. J'utilise Grails-3.2.3. – larand