This commit is contained in:
Daniel García Aubert 2016-10-28 12:29:28 +02:00
parent 224a4c933a
commit 7b48e43d92

View File

@ -209,17 +209,17 @@ JobBackend.prototype.listWorkInProgressJob = function (callback) {
usersQueue.defer(this.listWorkInProgressJobByUser.bind(this), userName); usersQueue.defer(this.listWorkInProgressJobByUser.bind(this), userName);
}.bind(this)); }.bind(this));
usersQueue.awaitAll(function (err, results) { usersQueue.awaitAll(function (err, userWorkInProgressJobs) {
if (err) { if (err) {
return callback(err); return callback(err);
} }
var usersRes = userNames.reduce(function (users, userName, index) { var workInProgressJobs = userNames.reduce(function (users, userName, index) {
users[userName] = results[index]; users[userName] = userWorkInProgressJobs[index];
return users; return users;
}, {}); }, {});
callback(null, usersRes); callback(null, workInProgressJobs);
}); });
}.bind(this)); }.bind(this));