Sequence request for new bonfire to wait until save operation, making bonfire fetch unsolved bonfires at a much faster rate to ensure data sync

This commit is contained in:
Nathan Leniz
2015-01-28 17:17:45 -05:00
parent 7ea08f3074
commit 9fa0323049
3 changed files with 24 additions and 28 deletions

View File

@@ -37,7 +37,7 @@ exports.returnNextBonfire = function(req, res, next) {
return res.redirect('bonfires/meet-bonfire');
}
var currentTime = parseInt(+new Date() / 1000);
if (currentTime - req.user.lastContentSync > 86400) {
if (currentTime - req.user.lastContentSync > 10) {
req.user.lastContentSync = currentTime;
var completed = req.user.completedBonfires.map(function (elem) {
return elem._id;