Go with calculating streaks with fresh data as cached mongo can"t be relied upon

This commit is contained in:
terakilobyte
2015-05-05 21:21:13 -04:00
parent 517c37f633
commit ba78710c82

View File

@ -301,6 +301,7 @@ exports.returnUser = function(req, res, next) {
timeKeys = timeKeys.reverse(); timeKeys = timeKeys.reverse();
tmpLongest = 1; tmpLongest = 1;
user.currentStreak = 1;
var today = moment(Date.now()).format('YYYY-MM-DD'); var today = moment(Date.now()).format('YYYY-MM-DD');
if (moment(today).toString() === moment(timeKeys[0]).toString() || if (moment(today).toString() === moment(timeKeys[0]).toString() ||