Friday 21 December 2018

Running node-cron for a changing DB | asynchronously running a function for each entry

I am building something that will run a certain function every so often (I will have it running either every 1, 5, 15 or 60 minutes depending on a DB value). My project is learning how to make an HTTP/SSL monitoring service (yes I know many exist, this is for learning), so I would in theory have users signing up every so often and that I would want to include their checks in the periodic checks.​I have the functions that will do the HTTP/SSL checks already I just am not sure how I would be best to have `node-cron` to get the updated values from the database while being able to run all of the check asynchronously so that when I would have say 10,000 checks that it would not make the cron job last too long and cause issues with the next running of it.​Suggestions on how I could do this? I'm kind of lost on the most performance optimized way to handle it.

Submitted December 21, 2018 at 09:08PM by jsdfkljdsafdsu980p

No comments:

Post a Comment