From 09efb83ef36fb9212816450b75fb0bfc5e35f789 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Mon, 23 Dec 2013 15:40:16 -0500 Subject: [PATCH 1/2] make sure relativeTime doesn't display negative values --- public/src/utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/src/utils.js b/public/src/utils.js index 926c05a0c5..9acc0594d9 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -56,6 +56,10 @@ var now = +new Date(), difference = now - Math.floor(parseFloat(timestamp)); + if(difference < 0) { + difference = 0; + } + difference = Math.floor(difference / 1000); if (difference < 60) { From b504e2cd116374800e1e9a9c9e7294308dd3878f Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Mon, 23 Dec 2013 19:17:03 -0500 Subject: [PATCH 2/2] closes #658 --- src/database/redis.js | 6 ++++++ src/meta.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/database/redis.js b/src/database/redis.js index b5de542089..02941be081 100644 --- a/src/database/redis.js +++ b/src/database/redis.js @@ -30,6 +30,12 @@ redisClient = redis.createClient(nconf.get('redis:port'), nconf.get('redis:host')); } + redisClient.on('error', function (err) { + winston.error(err.message); + process.exit(); + }); + + module.client = redisClient; module.sessionStore = new connectRedis({ diff --git a/src/meta.js b/src/meta.js index 0182d8c4a8..b6861d9cd6 100644 --- a/src/meta.js +++ b/src/meta.js @@ -18,7 +18,7 @@ var fs = require('fs'), Meta.configs.list(function (err, config) { if(err) { - winston.error(err); + winston.error(err.message); return callback(err); } @@ -29,7 +29,7 @@ var fs = require('fs'), list: function (callback) { db.getObject('config', function (err, config) { if(err) { - return callback(new Error('could-not-read-config')); + return callback(err); } config = config || {};