SEBA-901 - handle adapter restart
Stops existing goroutines processing messages and
allows for ONUs not in the initialized state when
adapter reconnects to not attempt to rediscover.
Change-Id: Ie3951d6ad36b7c8b3a4ddfbf55850b8ed7cf35d8
diff --git a/internal/bbr/devices/olt.go b/internal/bbr/devices/olt.go
index 61af90a..7104880 100644
--- a/internal/bbr/devices/olt.go
+++ b/internal/bbr/devices/olt.go
@@ -214,7 +214,9 @@
}).Fatal("Cannot find ONU")
}
- go onu.ProcessOnuMessages(nil, client)
+ ctx, cancel := context.WithCancel(context.TODO())
+ go onu.ProcessOnuMessages(ctx, nil, client)
+ defer cancel()
go func() {