refactor: 更新 CheckRssJob 函数以每5分钟执行一次 RSS 检查,增强定时任务的灵活性和准确性
This commit is contained in:
parent
8d11b5e6ec
commit
ce7a0a505e
@ -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))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user