mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-04 17:29:22 +00:00
基于启动后通过github更新版本
This commit is contained in:
@@ -2,6 +2,8 @@ package system
|
||||
|
||||
import (
|
||||
"github.com/ayflying/p2p/internal/service"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
)
|
||||
|
||||
type sSystem struct{}
|
||||
@@ -12,6 +14,13 @@ func New() *sSystem {
|
||||
|
||||
func init() {
|
||||
service.RegisterSystem(New())
|
||||
|
||||
getDev, _ := g.Cfg().GetWithEnv(gctx.New(), "dev")
|
||||
if !getDev.Bool() {
|
||||
service.System().CheckUpdate()
|
||||
} else {
|
||||
g.Log().Debugf(gctx.New(), "开发模式,不检查更新")
|
||||
}
|
||||
}
|
||||
|
||||
func (system *sSystem) Init() {}
|
||||
|
||||
Reference in New Issue
Block a user