snapshot_poker_phase4_hotfix

This commit is contained in:
DeSqBlocki
2026-09-08 20:17:19 +02:00
parent 903a2f3081
commit 136a5902c0
2 changed files with 135 additions and 39 deletions
+28 -1
View File
@@ -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.`
);
}