Abort requests when session transactions cannot start

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2026-07-13 08:03:15 +08:00
parent ff67c554f7
commit aebbc4b889
14 changed files with 42 additions and 1 deletions
+3 -1
View File
@@ -51,7 +51,9 @@ func New(ctx *gin.Context) *Session {
ss.MainEng = db.MainEng.NewSession()
ss.UserEng = db.UserEng.NewSession()
ss.UserEng.Begin()
if err := ss.UserEng.Begin(); err != nil {
ss.Abort(err)
}
return ss
}