Saturday 13 May 2017

how to configure cronjob in nodejs?

I have a scenario where I have to use cronjob.

my code :

new CronJob({
      cronTime: '/10 00 * * * 1-5',
  onTick: function() {
       console.log('You will see this message every 15 mins mon-fri');
        //and here is my code which intract with db
  },
  start: false,
  timeZone: 'America/Los_Angeles'
});

so, how do cron will know that the db operation has successfully executed within 15 minutes? and what will happen if DB operation takes more than 15 minutes?

Any suggestion will really appreciable. Thanks



via user7390851

No comments:

Post a Comment