使用boot统一注册执行代码
This commit is contained in:
@@ -2,11 +2,8 @@ package boot
|
||||
|
||||
import (
|
||||
v1 "github.com/ayflying/utility_go/api/system/v1"
|
||||
"github.com/ayflying/utility_go/drivers/db/elasticsearch"
|
||||
"github.com/ayflying/utility_go/pkg/aycache"
|
||||
"github.com/ayflying/utility_go/service"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"math"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -22,16 +19,6 @@ func Boot() (err error) {
|
||||
return service.GameAct().Saves()
|
||||
})
|
||||
|
||||
//初始化ES
|
||||
elasticsearch.Init()
|
||||
|
||||
//初始化指标
|
||||
service.SystemCron().AddCron(v1.CronType_MINUTE, func() error {
|
||||
aycache.QPS.Set(math.Round(float64(aycache.QPSCount) / 60))
|
||||
aycache.QPSCount = 0
|
||||
return nil
|
||||
})
|
||||
|
||||
//初始化自启动方法
|
||||
for _, v := range _func {
|
||||
v()
|
||||
|
||||
Reference in New Issue
Block a user