We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2c32575 + d6c7237 commit 0ab40feCopy full SHA for 0ab40fe
instantout/reservation/manager.go
@@ -56,15 +56,22 @@ func (m *Manager) Run(ctx context.Context, height int32) error {
56
return err
57
}
58
59
- ntfnChan := m.cfg.NotificationManager.SubscribeReservations(ctx)
+ ntfnChan := m.cfg.NotificationManager.SubscribeReservations(runCtx)
60
61
for {
62
select {
63
case height := <-newBlockChan:
64
log.Debugf("Received block %v", height)
65
currentHeight = height
66
67
- case reservationRes := <-ntfnChan:
+ case reservationRes, ok := <-ntfnChan:
68
+ if !ok {
69
+ // The channel has been closed, we'll stop the
70
+ // reservation manager.
71
+ log.Debugf("Stopping reservation manager (ntfnChan closed)")
72
+ return nil
73
+ }
74
+
75
log.Debugf("Received reservation %x",
76
reservationRes.ReservationId)
77
_, err := m.newReservation(
0 commit comments