diff --git a/config.json b/config.json index 53b6bfb..1f4891f 100644 --- a/config.json +++ b/config.json @@ -14,5 +14,5 @@ "https://hostloc.com/forum.php?mod=rss&fid=45&auth=389ec3vtQanmEuRoghE%2FpZPWnYCPmvwWgSa7RsfjbQ%2BJpA%2F6y6eHAx%2FKqtmPOg" ], "refresh": 6, - "isUpdatePush": true + "autoUpdatePush": 1 } diff --git a/main.go b/main.go index 4a57875..d129695 100644 --- a/main.go +++ b/main.go @@ -14,9 +14,9 @@ import ( ) type Config struct { - Values []string `json:"values"` - ReFresh int `json:"refresh"` - IsUpdatePush bool `json:"isUpdatePush"` + Values []string `json:"values"` + ReFresh int `json:"refresh"` + AutoUpdatePush int `json:"autoUpdatePush"` } var ( @@ -88,10 +88,10 @@ func wsHandler(w http.ResponseWriter, r *http.Request) { } } //如果未配置则不自动更新 - if !rssUrls.IsUpdatePush { + if rssUrls.AutoUpdatePush == 0 { return } - time.Sleep(time.Duration(rssUrls.ReFresh+1) * time.Minute) + time.Sleep(time.Duration(rssUrls.AutoUpdatePush) * time.Minute) } }