My ex boss had a weird bug where when he used setInterval
with a long delay interval:
setInterval(func, 3000000 /*50 minutes*/);
Node.js crashed.
func
can be even a simple function that simply console.log('something')
.
Someone suggested him to wrap an anonymous function around func
, and it actually solved his issue.
As much as I know, it shouldn't make a difference and even considered to be a bad practice at least in browsers' javascript.
Is there a difference in Node.js between
setInterval(func, delay)
setInterval(function(){func()}, delay)
or is it a bug in Node.js?
UPDATE: