基于启动后通过github更新版本

This commit is contained in:
2025-10-30 17:39:32 +08:00
parent c91c3149c0
commit 42404bb8e5
4 changed files with 203 additions and 0 deletions

View File

@@ -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() {}