🎨 优化初始化逻辑

This commit is contained in:
源文雨
2022-03-07 13:40:32 +08:00
parent f38f3ab69c
commit 3911b5ed82
25 changed files with 58 additions and 67 deletions

View File

@@ -3,13 +3,11 @@ package reborn
import (
"encoding/json"
"github.com/FloatTech/zbputils/control/order"
"github.com/FloatTech/zbputils/file"
)
// load 加载rate数据
func load(area *rate, jsonfile string) error {
defer order.DoneOnExit()()
data, err := file.GetLazyData(jsonfile, true, true)
if err != nil {
return err

View File

@@ -23,7 +23,6 @@ func init() {
go func() {
datapath := en.DataFolder()
jsonfile := datapath + "rate.json"
defer order.DoneOnExit()()
area := make(rate, 226)
err := load(&area, jsonfile)
if err != nil {