fix(multiplayer): repair PostgreSQL integration invariants

This commit is contained in:
Josh Creek
2026-09-04 15:43:31 +01:00
parent 0acf144f45
commit e6733bd6cb
4 changed files with 43 additions and 12 deletions
+2 -1
View File
@@ -44,7 +44,7 @@ const ExpireStalledAllocationsSQL = `WITH stalled AS (
'event', 'state_changed',
'revision', failed.revision,
'resource_id', failed.match_id,
'occurred_at', $4,
'occurred_at', $4::timestamptz,
'state', 'FAILED',
'match_id', failed.match_id,
'player_ids', COALESCE((
@@ -54,6 +54,7 @@ const ExpireStalledAllocationsSQL = `WITH stalled AS (
)
FROM failed
ON CONFLICT DO NOTHING
RETURNING event_id
)
SELECT (SELECT count(*) FROM failed), (SELECT count(*) FROM requeued), (SELECT count(*) FROM events)`