snapshot_poker_phase4_hotfix
This commit is contained in:
+28
-1
@@ -153,6 +153,32 @@ async function recoverPoker(
|
||||
const result =
|
||||
await service.recover();
|
||||
|
||||
const activeTables =
|
||||
await service.listActiveTables();
|
||||
|
||||
/*
|
||||
* Rehydrate every still-active public Poker table after
|
||||
* restart, even when no recovery action was necessary.
|
||||
* Mongo remains authoritative; the Discord embed is only
|
||||
* a projection of the current stored game state.
|
||||
*/
|
||||
|
||||
for (const game of activeTables) {
|
||||
try {
|
||||
await refreshPokerTableMessage(
|
||||
client,
|
||||
game
|
||||
);
|
||||
}
|
||||
catch (error) {
|
||||
console.error(
|
||||
`[Poker] Failed to refresh active table ${game.gameId}:`,
|
||||
error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (
|
||||
const turn
|
||||
of result.turns ?? []
|
||||
@@ -212,7 +238,8 @@ async function recoverPoker(
|
||||
`${result.cashouts.length} cash-out(s), ` +
|
||||
`${result.closingTables.length} closing table(s), ` +
|
||||
`${result.turns.length} expired turn(s), ` +
|
||||
`${result.lobbies.length} expired lobby/lobbies.`
|
||||
`${result.lobbies.length} expired lobby/lobbies, ` +
|
||||
`${activeTables.length} active table(s) refreshed.`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user