fix: handle Begin() error in db.NewSession() instead of ignoring it

This commit is contained in:
kolaente
2026-02-24 13:13:48 +01:00
parent 23176bb8e1
commit 1167b08e70

View File

@@ -408,7 +408,9 @@ func WipeEverything() error {
// s.Close() will auto-rollback any uncommitted transaction.
func NewSession() *xorm.Session {
s := x.NewSession()
_ = s.Begin()
if err := s.Begin(); err != nil {
log.Fatalf("Failed to begin database transaction: %s", err)
}
return s
}