Cluster lib isMaster

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: = function () {
  if (clusterLib.isMaster()) {'Executing task.....')
      name: 'callTask'

This is the logs in the server:

17:04:59.999 INFO - Executing job [myapp:job-callTask]
17:05:00.014 INFO - 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.

If the Cronjob App has the same problem as your code, then the problem likely isn’t in your code, but has something to do with the cluster setup.

Have you taken a look at the statistics endpoint for each of your sever nodes?

If you examine the cluster statistics underneath http://<hostname>:2609/cluster, then that should tell you the isMaster value for that node.

Example result: