Rollback live sessions on panic

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2026-07-13 08:03:12 +08:00
parent 96b7951ee1
commit ff67c554f7
5 changed files with 24 additions and 12 deletions
+2 -3
View File
@@ -14,13 +14,12 @@ import (
func gameOver(ctx *gin.Context) {
ss := session.Get(ctx)
token := ""
defer func() {
defer ss.FinalizeOrRollbackAfter(func() {
if ss.UserEng != nil {
deleteRandomLiveByToken(ss, token)
ss.ClearLiveInProgress()
}
ss.Finalize()
}()
})
req := rliveschema.TokenReq{}
err := honokautils.ParseRequestData(ctx, &req)