Cristi
Cristi

Reputation: 95

Node.js setInterval lifetime

How long can a setInterval last in node.js. I need to use it as a cron job. I don't care if the server restarts and resets the interval, important thing is not to stop.

Upvotes: 1

Views: 776

Answers (1)

Vinay
Vinay

Reputation: 6881

setInterval runs until it is stopped using clearInterval or something forces it like you said a server restart. If the server restarts and resets the interval it just starts again. Have a look at this link here this might help you if you are trying to have a cron job.

Upvotes: 1

Related Questions