Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions cmd/internal/core/phone-home.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ func (c *Core) ConstantlyPhoneHome(ctx context.Context, interval time.Duration)

ifaceName := iface.Name
// constantly observe LLDP traffic on current machine and current interface
discoveryResultChanWG.Add(1)
go func() {
discoveryResultChanWG.Go(func() {
defer discoveryResultChanWG.Done()
err = lldpcli.Start(c.log, discoveryResultChan)
if err != nil {
c.log.Error("unable to start lldp discovery for interface", "interface", ifaceName)
c.log.Error("unable to start lldp discovery for interface", "interface", ifaceName, "error", err)
}
}()
})
}

// wait all lldp routines to finish to close result channel
Expand Down Expand Up @@ -81,7 +80,7 @@ func (c *Core) ConstantlyPhoneHome(ctx context.Context, interval time.Duration)
select {
case <-ticker.C:
msgs := []phoneHomeMessage{}
phoneHomeMessages.Range(func(key, value interface{}) bool {
phoneHomeMessages.Range(func(key, value any) bool {
msg, ok := value.(phoneHomeMessage)
if !ok {
return true
Expand Down