From 0ac2bdf656dec740b72affb66c0ec60e26eea152 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Thu, 20 Dec 2012 08:56:17 +0300 Subject: [PATCH] Set default write concern to avoid warnings --- acs.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acs.coffee b/acs.coffee index 6408d35..ce3b41d 100644 --- a/acs.coffee +++ b/acs.coffee @@ -15,11 +15,13 @@ currentClientIP = null dbserver = new mongo.Server(config.MONGODB_SOCKET, 0, {auto_reconnect: true}) tasksCollection = null devicesCollection = null -db = new mongo.Db(config.DATABASE_NAME, dbserver, {native_parser:true}) +db = new mongo.Db(config.DATABASE_NAME, dbserver, {native_parser:true, safe:true}) + db.open( (err, db) -> db.collection('tasks', (err, collection) -> tasksCollection = collection - tasksCollection.ensureIndex({device: 1, timestamp: 1}) + tasksCollection.ensureIndex({device: 1, timestamp: 1}, (err) -> + ) ) db.collection('devices', (err, collection) ->