From ce7a0a505e21c249b84c8afd75df6a471a7dd91a Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Thu, 17 Jul 2025 15:18:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20CheckRssJob=20?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E4=BB=A5=E6=AF=8F5=E5=88=86=E9=92=9F?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E4=B8=80=E6=AC=A1=20RSS=20=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=BC=BA=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E7=81=B5=E6=B4=BB=E6=80=A7=E5=92=8C=E5=87=86=E7=A1=AE?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/rss/job.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/handler/rss/job.go b/handler/rss/job.go index 2e40c25..656f2e8 100644 --- a/handler/rss/job.go +++ b/handler/rss/job.go @@ -23,13 +23,13 @@ func init() { */ func CheckRssJob() { defer util.ReportPanicToDev() - //每个整点和半点执行一次 + //每个整5分钟执行一次 for { now := time.Now() - if now.Minute() == 0 || now.Minute() == 30 { + if now.Minute()%5 == 0 { go CheckNewRss() } - nextAwake := 30 - now.Minute()%30 + nextAwake := 5 - now.Minute()%5 time.Sleep(time.Minute * time.Duration(nextAwake)) } }