Andrew
Andrew

Reputation: 2363

Grails Quartz - Jobs are running even when nothing is scheduled

I have defined a job as follows in the jobs folder in grails:

class TransferFilesQueueJob {

  def execute() {
    print "File Transfer Job start!"
    FileTransfer.transferFilesToHere()
    print "File Transfer Job end!"
  }
}

When running my application in IntelliJ, this job runs every few seconds or so. Even after restarting. Any idea why? I don't have any other places that are scheduling it.

I had a declaration earlier on, but I've removed it. It seems like it is storing configuration somewhere else or job state information. But I cannot find where. -- Further notes I renamed the job class and it stopped running. So this seems to point to the job being persisted somewhere. However, I have never set it to have any kind of persistance beyond the current running of the server.

Upvotes: 1

Views: 1253

Answers (1)

schmolly159
schmolly159

Reputation: 3881

The Quartz plugin has a default simple trigger for every Job, which is used if no trigger is set by the programmer, and which fires every few seconds. To have no triggers attached to a Job, set an empty static triggers block in the class.

static triggers = { }

Upvotes: 5

Related Questions