0

I'm a noob Nodejs developer. I've written an app that gets a list of URLs from a DB table and scrape them. It then goes over those URLs and inserts into another table the results. when I run the app it never quits (I'm assuming it because the MySQL connection never ends by me) but when I call con.end() (using a pool) it then throws an error since it's still working.

How can I determine when I can close the connection pool? promise all doesn't cut it cause sometimes I have rejections but its still ok by me. help :-)

Jacob
  • 586
  • 6
  • 27
Mr.B
  • 1
  • Does this answer your question? [Wait until all promises complete even if some rejected](https://stackoverflow.com/questions/31424561/wait-until-all-promises-complete-even-if-some-rejected) – Matt Aug 14 '20 at 04:22
  • Welcome to Stack Overflow! Please [take the tour](http://stackoverflow.com/tour) (you get a badge!) and read through the [help center](https://stackoverflow.com/help), in particular [good question?](https://stackoverflow.com/help/how-to-ask) Your best bet here is to do your research, [search](https://stackoverflow.com/help/searching) for related topics on SO, and give it a go. If you get stuck and can't get unstuck after doing more research, post a [Verifiable Example](http://stackoverflow.com/help/mcve) of your attempt and specifically say where you're stuck. People will be glad to help. – Jacob Aug 14 '20 at 04:50

0 Answers0