🎨 内核尚未完全启动的判断移到 API 层

This commit is contained in:
Liang Ding 2022-08-27 15:33:06 +08:00
parent 23a30f0649
commit 15e2476126
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 7 additions and 15 deletions

View file

@ -49,6 +49,13 @@ func performTransactions(c *gin.Context) {
return
}
if !util.IsBooted() {
ret.Code = -1
ret.Msg = fmt.Sprintf(model.Conf.Language(74), int(util.GetBootProgress()))
ret.Data = map[string]interface{}{"closeTimeout": 5000}
return
}
var transactions []*model.Transaction
if err = gulu.JSON.UnmarshalJSON(data, &transactions); nil != err {
ret.Code = -1
@ -70,12 +77,6 @@ func performTransactions(c *gin.Context) {
ret.Code = 1
return
}
if model.ErrNotFullyBoot == err {
ret.Code = -1
ret.Msg = fmt.Sprintf(model.Conf.Language(74), int(util.GetBootProgress()))
ret.Data = map[string]interface{}{"closeTimeout": 5000}
return
}
if nil != err {
tx, txErr := sql.BeginTx()
if nil != txErr {