Take the following basic example:
Code: Select all
console.log('Setting up a 60-minute interval. It is now %s', (new Date()));
setInterval(function () {
console.log('60-minute interval trigger! It is now %s', (new Date()));
}, 1000 * 60 * 60);
console.log('BOOTED');
Now with another example, including a 20-minute timer:
Code: Select all
console.log('Setting up a 20 and 60-minute interval. It is now %s', (new Date()));
setInterval(function () {
console.log('20-minute interval trigger! It is now %s', (new Date()));
}, 1000 * 60 * 20);
setInterval(function () {
console.log('60-minute interval trigger! It is now %s', (new Date()));
}, 1000 * 60 * 60);
console.log('BOOTED');
I have no idea what's causing this issue. Is my node process put to sleep or something if the interval is greater than 20/30 minutes? Does the 20-minute interval keep it awake in the second example? How do I debug this?