summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--portlist/poller.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/portlist/poller.go b/portlist/poller.go
index d7bea2777..51e8f9294 100644
--- a/portlist/poller.go
+++ b/portlist/poller.go
@@ -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
}