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 {