0

I have a fairly simple NodeJS script that is not exiting gracefully when done (this is a worker and I want to fire it up using a cron job / heroku scheduler)

Once it has finished its task it just sits there waiting. It doesn't use express / a web server etc and as far as I can tell I have resolved all callbacks.

Is there some way to tell what node is still working on / what handlers are open?

My imported libraries are Request, Q & Mongoose.

Ryan Knell
  • 6,204
  • 2
  • 40
  • 32

1 Answers1

1

You definitely need to close the mongodb connections that mongoose has open on your behalf by calling mongoose.disconnect(). Have you tried that?

Peter Lyons
  • 142,938
  • 30
  • 279
  • 274