From 46591b24c8b19c20be7769456cb7e2a812173401 Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Thu, 3 Apr 2014 14:22:18 +0900 Subject: [PATCH] Insert log messages with soft durability. --- lib/db/api.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/db/api.js b/lib/db/api.js index b3d2c154..5783f22e 100644 --- a/lib/db/api.js +++ b/lib/db/api.js @@ -40,13 +40,16 @@ dbapi.loadGroup = function(email) { dbapi.saveDeviceLog = function(serial, entry) { return db.run(r.table('logs').insert({ - serial: entry.serial - , timestamp: r.epochTime(entry.timestamp) - , priority: entry.priority - , tag: entry.tag - , pid: entry.pid - , message: entry.message - })) + serial: entry.serial + , timestamp: r.epochTime(entry.timestamp) + , priority: entry.priority + , tag: entry.tag + , pid: entry.pid + , message: entry.message + } + , { + durability: 'soft' + })) } dbapi.saveDevice = function(serial, device) {