From 44007a04b00f5b136210181a90dea57788534c98 Mon Sep 17 00:00:00 2001 From: srcrs Date: Wed, 2 Aug 2023 01:26:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8update=20push=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=8F=AF=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.json | 2 +- main.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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) } }