From 435375de95ebb628d28be53e563555824ed44aed Mon Sep 17 00:00:00 2001 From: fengqi Date: Sat, 5 Aug 2023 14:18:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- music_videos/collector.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/music_videos/collector.go b/music_videos/collector.go index 8f70789..386f51a 100644 --- a/music_videos/collector.go +++ b/music_videos/collector.go @@ -189,13 +189,9 @@ func (c *Collector) runScanner() { task() ticker := time.NewTicker(time.Second * time.Duration(c.config.Collector.CronSeconds)) - for { - select { - case <-ticker.C: - task() - - utils.Logger.Debug("run music video scanner finished") - } + for range ticker.C { + task() + utils.Logger.Debug("run music video scanner finished") } }