cwt-wa / cwt

Crespo’s Worms Tournament (CWT) is the most prestigious tournament of Team17’s strategy game title Worms Armageddon held annually since 2002.
https://cwtsite.com/
5 stars 2 forks source link

Move game stats done check into client #249

Closed Zemke closed 3 years ago

Zemke commented 3 years ago

Since a DB connection is not released for the duration of an SSE stream, there shouldn’t be any DB queries within such SSE handling. Therefore no DB queries should happen when streaming.

Currently Game Stats are always retrieved via an event source. Although enough time since game report has passed to just request stats traditionally. For that case—especially to remove DB queries for the even streaming—there should be a new endpoint to get game stats via a simple GET.

It is the upon the client to decide on whether or not game stats processing could still take place and therefore request the streaming source.