How to use the gracefulShutdown function from node-schedule

Find comprehensive JavaScript node-schedule.gracefulShutdown code examples handpicked from public code repositorys.

125
126
127
128
129
130
131
132
133
134
135
    }
  });
}


exports.rescheduleAllServers = () => {
  jobscheduler.gracefulShutdown()
    .then(function () {
      jobscount = 0;
      for (const [key, value] of Object.entries(serverjson_cfg)) {
        if (typeof serverjson_cfg[key]['restartScheduler'] !== "undefined" && serverjson_cfg[key]['restartScheduler']['enabled'] == 'true') {
fork icon11
star icon21
watch icon3

+ 13 other calls in file

1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
}




// Enable graceful stop
process.once('SIGINT', () => {
    scheduler.gracefulShutdown().then(res => {
        bot.stop('SIGINT')
    });


})
fork icon0
star icon0
watch icon1

+ 15 other calls in file

28
29
30
31
32
33
34
35
36
37
var activateConfig = crypter.decryptObject(Readdata.toString());
var activateData=activateConfig;
// console.log('this is activate config data:31 - pull data : ', activateConfig);
!activateConfig.stopScheduler && lic.isValid(function (valid) {
  if(!valid || (!valid && Object.entries(myJobs).length)) {
    schedule.gracefulShutdown().then(() => {
      console.log('schedulers stopped!');
      shutDownGracefully();
    }).catch((e)=>{console.log('this is err : ',e)});
    // console.log('this is activate config data:38 - pull data : is not valid in pull data  ', activateConfig, valid);
fork icon0
star icon0
watch icon0

+ 7 other calls in file