From ab2c85f42fe03ac84b461ca619024ea5d99214df Mon Sep 17 00:00:00 2001 From: timerzz Date: Wed, 4 Dec 2024 19:32:57 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/proxy/proxy.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/proxy/proxy.go b/pkg/proxy/proxy.go index 13c1e9d..4dbd89f 100644 --- a/pkg/proxy/proxy.go +++ b/pkg/proxy/proxy.go @@ -78,11 +78,11 @@ func (p *ProxyPool) Update() { } // CronUpdate 定时更新 -func (p *ProxyPool) CronUpdate(ctx context.Context, interval time.Duration) { - if interval == 0 { - interval = time.Minute * 30 +func (p *ProxyPool) CronUpdate(ctx context.Context) { + if p.cfg.Interval == 0 { + p.cfg.Interval = time.Minute * 30 } - ticker := time.NewTicker(interval) + ticker := time.NewTicker(p.cfg.Interval) defer ticker.Stop() for { select {