Skip to content

Commit

Permalink
Refresh port status every minute unless there are events to process
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Floeder <[email protected]>
  • Loading branch information
ajfloeder committed Aug 19, 2024
1 parent 759346f commit 243a1a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/manager-fabric/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@ func (m *monitor) Run() {
s := &m.fabric.switches[idx]

// The normal path is when the switch is operating without issue and we can
// poll the switch for any events, and process those events
// poll the switch for any events then process those events
if s.isReady() {

if events, err := s.dev.GetEvents(); err == nil {

// If there are no events, refresh port status to ensure we're up to date.
if len(events) == 0 {
s.refreshPortStatus()
continue
}

for _, event := range events {
physPortId, isDown := m.getEventInfo(event)

Expand Down

0 comments on commit 243a1a7

Please sign in to comment.