mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-06 00:22:20 -08:00
Ensure ticker stop
This commit is contained in:
1 parent
bfda034655
commit
fb13df273a
1 file changed
+4
-2
+4
-2
@@ -169,8 +169,10 @@ func (p *Poller) Run(ctx context.Context) (chan Update, error) {
|
||||
return nil, fmt.Errorf("error initializing poller: %w", p.initErr)
|
||||
}
|
||||
tick := time.NewTicker(p.Interval)
|
||||
defer tick.Stop()
|
||||
go p.runWithTickChan(ctx, tick.C)
|
||||
go func() {
|
||||
defer tick.Stop()
|
||||
p.runWithTickChan(ctx, tick.C)
|
||||
}()
|
||||
return p.c, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user