mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
redis part 6, fix test suites
This commit is contained in:
@@ -22,9 +22,9 @@ router.post('/sockets/broadcast', function (req, res) {
|
||||
|
||||
router.get('/games/state', async (req, res) => {
|
||||
const gamesArray = [];
|
||||
await timerManager.client.keys('*').then(async (r) => {
|
||||
Object.values(r).forEach((v) => gamesArray.push(JSON.parse(v)));
|
||||
});
|
||||
const keys = await eventManager.client.keys('*');
|
||||
const values = await eventManager.client.mGet(keys);
|
||||
values.forEach((v) => gamesArray.push(JSON.parse(v)));
|
||||
res.status(200).send(gamesArray);
|
||||
});
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ const Events = [
|
||||
id: EVENT_IDS.END_GAME,
|
||||
stateChange: async (game, socketArgs, vars) => {
|
||||
game.status = globals.STATUS.ENDED;
|
||||
if (vars.timerManager.timerThreads[game.accessCode]) {
|
||||
if (game.hasTimer && vars.timerManager.timerThreads[game.accessCode]) {
|
||||
vars.logger.trace('KILLING TIMER PROCESS FOR ENDED GAME ' + game.accessCode);
|
||||
vars.timerManager.timerThreads[game.accessCode].kill();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user