зеркало из https://github.com/mozilla/galaxy-api.git
fixed queue position retrieval, updated gameByStatus sets on game moderation
This commit is contained in:
Родитель
2520cf2117
Коммит
485f21e9b3
|
@ -48,6 +48,10 @@ function updateGame(client, gameSlug, updatedGame, callback) {
|
|||
client.hset('gamesBySlug', updatedGame.slug, game.id);
|
||||
client.hdel('gamesBySlug', game.slug);
|
||||
}
|
||||
if (game.status != updatedGame.status) {
|
||||
client.zrem('gamesByStatus:' + game.status, game.id);
|
||||
client.zadd('gamesByStatus:' + updatedGame.status, Date.now(), game.id);
|
||||
}
|
||||
callback(null, updatedGame);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -128,7 +128,6 @@ module.exports = function(server) {
|
|||
db.plsNoError(res, done, function(rank) {
|
||||
game.queuePosition = rank + 1;
|
||||
done();
|
||||
console.log(game)
|
||||
resolve(game);
|
||||
}));
|
||||
} else {
|
||||
|
@ -137,8 +136,7 @@ module.exports = function(server) {
|
|||
});
|
||||
}
|
||||
|
||||
gamesUpToCount.forEach(queuePromise);
|
||||
Promise.all(gamesUpToCount).then(function(gamesWithQueuePosition){
|
||||
Promise.all(gamesUpToCount.map(queuePromise)).then(function(gamesWithQueuePosition){
|
||||
gamesWithQueuePosition.map(gamelib.publicGameObj);
|
||||
res.json(gamesWithQueuePosition);
|
||||
done();
|
||||
|
|
Загрузка…
Ссылка в новой задаче