profile
viewpoint

Ask questionsonTick may call onComplete at the end of each run. How?

Description

  • onTick - [REQUIRED] - The function to fire at the specified time. If an onComplete callback was provided, onTick will receive it as an argument. onTick may call onComplete when it has finished its work.
  • onComplete - [OPTIONAL] - A function that will fire when the job is stopped with job.stop(), and may also be called by onTick at the end of each run.

I have written the following code. onTick callback cronOnTick is called however onComplete callback cronOnComplete is not at the end of an onTick run.

If an onComplete callback was provided, onTick will receive it as an argument.

    export const job = new CronJob(
        cronExpression, 
        cronOnTick, 
        cronOnComplete, 
        true, 
        'UTC'
    );

    job.start();

The documentation is not clear how to get onComplete to be called upon the completion of onTick, other than if the job is stopped.

Screenshots

No response

Additional information

No response

kelektiv/node-cron

Answer questions jeff00seattle

@intcreator Thank you, I am good. I should have closed.

useful!

Related questions

No questions were found.
source:https://uonfu.com/
answerer
Jeffrey Tanner jeff00seattle Seattle, WA deep-minded Engineer + satisfaction Cultivator: Learn, Build; Rinse, Repeat https://www.linkedin.com/in/jefftanner/
Github User Rank List