Enonic version: 7.0.2
OS: Linux Mint 19.2
I’m trying use the cluster lib, because my task is started more than 1 time in cluster when I not used the lib.
But when I executed the code in cluster, the task is not started.
The code of job (job-callTask) is this:
exports.run = function () {
if (clusterLib.isMaster()) {
log.info('Executing task.....')
taskLib.submitNamed({
name: 'callTask'
})
}
}
This is the logs in the server:
17:04:59.999 INFO c.e.app.cronjob.runner.JobRunnerImpl - Executing job [myapp:job-callTask]
17:05:00.014 INFO c.e.app.cronjob.runner.JobRunnerImpl - Executed job [myapp:job-callTask] in 13 ms
And the log that I put in the conditional block is not printed. The task is not started too.
Do you have any idea what I making wrong?
PS.: I used the “Cronjob App” to call the task.
PS.: I tried insert the conditional of isMaster() in the task, but not works too.