mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
add some more debugging for cron
This commit is contained in:
parent
2bb1e5cf7f
commit
85f4a2884a
1 changed files with 7 additions and 1 deletions
|
|
@ -268,13 +268,18 @@ api.cron = function(req, res, next) {
|
||||||
Group.tavernBoss(user,progress);
|
Group.tavernBoss(user,progress);
|
||||||
if (!quest) return user.save(next);
|
if (!quest) return user.save(next);
|
||||||
|
|
||||||
|
// FOR DEBUGGING, PLEASE IGNORE
|
||||||
|
var opStatus = null;
|
||||||
|
|
||||||
// If user is on a quest, roll for boss & player, or handle collections
|
// If user is on a quest, roll for boss & player, or handle collections
|
||||||
// FIXME this saves user, runs db updates, loads user. Is there a better way to handle this?
|
// FIXME this saves user, runs db updates, loads user. Is there a better way to handle this?
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(cb){
|
function(cb){
|
||||||
|
opStatus = 'saveUser';
|
||||||
user.save(cb); // make sure to save the cron effects
|
user.save(cb); // make sure to save the cron effects
|
||||||
},
|
},
|
||||||
function(saved, count, cb){
|
function(saved, count, cb){
|
||||||
|
opStatus = 'runQuest';
|
||||||
var type = quest.boss ? 'boss' : 'collect';
|
var type = quest.boss ? 'boss' : 'collect';
|
||||||
Group[type+'Quest'](user,progress,cb);
|
Group[type+'Quest'](user,progress,cb);
|
||||||
},
|
},
|
||||||
|
|
@ -289,7 +294,8 @@ api.cron = function(req, res, next) {
|
||||||
stack: (err.stack || err.message || err),
|
stack: (err.stack || err.message || err),
|
||||||
body: req.body, headers: req.header,
|
body: req.body, headers: req.header,
|
||||||
auth: (req.headers['x-api-user'] + ' | ' + req.headers['x-api-key']),
|
auth: (req.headers['x-api-user'] + ' | ' + req.headers['x-api-key']),
|
||||||
originalUrl: req.originalUrl
|
originalUrl: req.originalUrl,
|
||||||
|
opStatus: opStatus
|
||||||
});
|
});
|
||||||
res.locals.user = saved;
|
res.locals.user = saved;
|
||||||
next(err,saved);
|
next(err,saved);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue