Skip to content

Server connection won't close#66

Open
xcoderzach wants to merge 1 commit intomarcello3d:masterfrom
xcoderzach:master
Open

Server connection won't close#66
xcoderzach wants to merge 1 commit intomarcello3d:masterfrom
xcoderzach:master

Conversation

@xcoderzach
Copy link
Copy Markdown
Contributor

It seems to be an issue with MongolianServer._connection not having a cached value until one of the connections callbacks is called, it fixes the issue of you call the callback right away.

it doesn't break any of the existing tests, but I couldn't think of a clever way to test this without digging into internals.

@jaekwon
Copy link
Copy Markdown

jaekwon commented Dec 20, 2011

#67

@demian85
Copy link
Copy Markdown

I don't get it, how can i close the connection? my script won't finish!

@jaekwon
Copy link
Copy Markdown

jaekwon commented Jan 23, 2012

force your script to close the server connection in a callback that actually uses one of the collections, say, listing the available indices for the collection.

      getCollection (err, collection) ->
        collection.indexes (err, indexes) ->
          server.close()

@defunctzombie
Copy link
Copy Markdown

db.server.close() or just server.close() if your have the server instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants