mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
bug fix
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"neko/pkg/speedtest"
|
||||
"nekobox_core/box_main"
|
||||
"reflect"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
box "github.com/sagernet/sing-box"
|
||||
@@ -38,6 +39,16 @@ func (s *server) Start(ctx context.Context, in *gen.LoadConfigReq) (out *gen.Err
|
||||
log.Println("Start:", in.CoreConfig)
|
||||
}
|
||||
|
||||
if neko_common.GetBuildTime() > 0 {
|
||||
if time.Now().Unix() >= neko_common.GetExpireTime() {
|
||||
err = errors.New("Your version is too old! Please update!! 版本太旧,请升级!")
|
||||
return
|
||||
} else if time.Now().Unix() >= (neko_common.GetExpireTime() - 30*24*60*60) {
|
||||
log.Println("Your version is too old! Please update!! 版本太旧,请升级!")
|
||||
log.Println("This version expires on " + time.Unix(neko_common.GetExpireTime(), 0).Format("2006-01-02"))
|
||||
}
|
||||
}
|
||||
|
||||
if instance != nil {
|
||||
err = errors.New("instance already started")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user