human fight sequence fix
This commit is contained in:
@@ -454,14 +454,6 @@ fightsRouter.get('/:id/stream', (c) => {
|
||||
})
|
||||
})
|
||||
|
||||
const cleanupGlobal = fightEvents.onAll((event) => {
|
||||
if (event.fightId === fightId && event.type === 'fight_end') {
|
||||
void stream.writeSSE({
|
||||
event: 'fight_end',
|
||||
data: JSON.stringify({ ...event.data, spectators: spectatorCounts.get(fightId) || 0 }),
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
@@ -495,7 +487,7 @@ fightsRouter.get('/:id/stream', (c) => {
|
||||
spectatorCounts.set(fightId, current - 1)
|
||||
}
|
||||
cleanup()
|
||||
cleanupGlobal()
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user