Permalink
Browse files

[fix] stdlib: Stopped loogin close messages without log set.

  • Loading branch information...
1 parent 0171871 commit 5d41d0252c43a2d73408bb6b8398199163119955 @nrs135 nrs135 committed Nov 15, 2011
Showing with 8 additions and 2 deletions.
  1. +5 −2 stdlib/apis/mongo/connection.opa
  2. +3 −0 stdlib/apis/mongo/cursor.opa
@@ -86,7 +86,9 @@ MongoConnection = {{
do System.at_exit( ->
if db.link_count.get() > 0
then
- do ML.info("MongoConnection.open","closing mongo (exit) {db.link_count.get()}",void)
+ do if db.mongo.log
+ then ML.info("MongoConnection.open",
+ "closing mongo (exit) link_count={db.link_count.get()}",void)
_ = MongoDriver.close(db.mongo)
void
else void)
@@ -155,7 +157,8 @@ MongoConnection = {{
do db.link_count.set(lc-1)
if lc <= 1
then
- do ML.info("MongoConnection.close","closing mongo (close) link_count={db.link_count.get()}",void)
+ do if db.mongo.log
+ then ML.info("MongoConnection.close","closing mongo (close) link_count={db.link_count.get()}",void)
_ = MongoDriver.close(db.mongo)
void
else void
@@ -356,7 +356,10 @@ MongoCursor = {{
* Example: [find_all(m, ns, query, limit)]
*
* Creates and destroys a cursor.
+ *
+ * {b NOTE: reverses the order.}
**/
+ // TODO: fields and orderby here
find_all(m:Mongo.db, ns:string, query:Bson.document, limit:int): Mongo.results =
cursor = set_query(set_limit(init(m,ns),limit),{some=query})
(cursor,results) =

0 comments on commit 5d41d02

Please sign in to comment.