0

In my application i will have to schedule multiple cron task and the application should be run "forever" (in few words, have to stop just only when i kill it).

Express framework use something like app.listen that run indefinitely.

How i can do something like this? My wait will not be "active", because all cron must continue to work.

I cant use (i think) something like setInterval. I've tried to search a lot but i havent find anytning like this.

Thanks

Mistre83
  • 2,677
  • 6
  • 40
  • 77
  • If you need help from here then you must abide by SO rules. Please post what you have done so far. From your question what you intend to do is not clear.. – Nidhin David May 28 '16 at 10:54
  • Unfortunally right now i havent write code to do this... because i dont know how to do. However, when i start my application (node index.js) this will schedule some CRON and when finished, the application should remain "active", without stop the CRON. I have post as example app.listen from express, that do "the same thing" – Mistre83 May 28 '16 at 11:04
  • 2
    [node forever](https://github.com/foreverjs/forever) : )) – moonwave99 May 28 '16 at 11:16
  • @moonwave99 Doesn't forever 'restarts' the app instead of not stoping it from dying? – Nidhin David May 28 '16 at 11:31

1 Answers1

0

You may use setInterval() to prevent the app from terminating. I hope this link provides more info on your issue: https://stackoverflow.com/a/23354058/3359432

Community
  • 1
  • 1
Nidhin David
  • 2,426
  • 3
  • 31
  • 45