Go with calculating streaks with fresh data as cached mongo can"t be relied upon
This commit is contained in:
@ -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() ||
|
||||||
|
Reference in New Issue
Block a user