redis effort part 5

This commit is contained in:
AlecM33
2023-01-17 21:00:41 -05:00
parent 81a132458e
commit e39cc61b4e
5 changed files with 167 additions and 98 deletions

View File

@@ -15,6 +15,12 @@ class TimerManager {
TimerManager.instance = this;
}
setUpSignalHandler = () => {
process.on('SIGTERM', (code) => {
console.log('received sigterm');
});
}
runTimer = async (game, namespace, eventManager, gameManager) => {
this.logger.debug('running timer for game ' + game.accessCode);
const gameProcess = fork(path.join(__dirname, '../GameProcess.js'));
@@ -26,7 +32,7 @@ class TimerManager {
await gameManager.refreshGame(game);
await eventManager.publisher.publish(
globals.REDIS_CHANNELS.ACTIVE_GAME_STREAM,
game.accessCode + ';' + msg.command + ';' + JSON.stringify(msg) + ';' + this.instanceId
eventManager.createMessageToPublish(game.accessCode, msg.command, this.instanceId, JSON.stringify(msg))
);
});