优化启动速度

This commit is contained in:
刘祥超
2023-04-10 20:57:38 +08:00
parent af13357985
commit e4145a2059
2 changed files with 8 additions and 12 deletions

View File

@@ -18,8 +18,6 @@ import (
"time"
)
var LatestSQLResult = &SQLDumpResult{}
// SQLExecutor 安装或升级SQL执行器
type SQLExecutor struct {
dbConfig *dbs.DBConfig
@@ -65,7 +63,14 @@ func (this *SQLExecutor) Run(showLog bool) error {
if this.logWriter != nil {
showLog = true
}
_, err = sqlDump.Apply(db, LatestSQLResult, showLog)
var sqlResult = &SQLDumpResult{}
err = json.Unmarshal(sqlData, sqlResult)
if err != nil {
return errors.New("decode sql data failed: " + err.Error())
}
_, err = sqlDump.Apply(db, sqlResult, showLog)
if err != nil {
return err
}