mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
redis effort part 5
This commit is contained in:
@@ -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))
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user