node-orm2 icon indicating copy to clipboard operation
node-orm2 copied to clipboard

App doesn't terminate

Open mitchpolska opened this issue 13 years ago • 4 comments

I have a problem, my app works but never terminate.

module.exports = getMovie: (url, type) -> orm.connect("mysql://root:root@localhost/name", (err, db) -> # my app body, many queries

How to terminate my app on end of my app body ?

mitchpolska avatar Jun 25 '13 14:06 mitchpolska

Like any node app, when you have pending I/O or timers, your app won't terminate. In your case it's probably because you didn't close the connection. Try calling db.close when you finish.

dresende avatar Jun 25 '13 14:06 dresende

running close() seems to have no effect

fanum avatar Jul 28 '13 03:07 fanum

@fanum: Exactly...

mitchpolska avatar Jul 28 '13 07:07 mitchpolska

Are you sure you don't have anything pending? Did you add a callback do db.close ? Put some callback printing something so you know everything is done (no queued query or something..).

dresende avatar Jul 29 '13 18:07 dresende