This commit is contained in:
cdle
2023-07-07 14:58:30 +08:00
parent 8c4e93d614
commit de0138d01c
2 changed files with 15 additions and 4 deletions
+14 -3
View File
@@ -19,13 +19,15 @@ import (
)
var DataHome = utils.GetDataHome()
var version = compiled_at
func GetVersion() (string, error) {
v, e := httplib.Get("http://172.96.255.172:8765/api/version").String()
if len(v) == 13 {
sillyGirl.Set("version", v)
if v != compiled_at {
console.Log("发现更新,版本号", v)
if version != v && v != compiled_at {
sillyGirl.Set("version", v)
console.Log("发现更新,版本号", v)
version = v
}
return v, e
}
@@ -33,6 +35,15 @@ func GetVersion() (string, error) {
}
func Init() {
go func() {
for {
GetVersion()
if version != compiled_at {
break
}
time.Sleep(time.Minute * 5)
}
}()
initLoc()
sillyGirl = MakeBucket("sillyGirl")
_, err := os.Stat(DataHome)
+1 -1
View File
@@ -23,7 +23,7 @@ func main() {
if err == nil {
app.Set("ip", ip)
}
core.GetVersion()
}()
core.Init()
if app.GetBool("anti_kasi") {