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
11 changes: 9 additions & 2 deletions instantout/reservation/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,22 @@ func (m *Manager) Run(ctx context.Context, height int32) error {
return err
}

ntfnChan := m.cfg.NotificationManager.SubscribeReservations(ctx)
ntfnChan := m.cfg.NotificationManager.SubscribeReservations(runCtx)

for {
select {
case height := <-newBlockChan:
log.Debugf("Received block %v", height)
currentHeight = height

case reservationRes := <-ntfnChan:
case reservationRes, ok := <-ntfnChan:
if !ok {
// The channel has been closed, we'll stop the
// reservation manager.
log.Debugf("Stopping reservation manager (ntfnChan closed)")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add newline before return

return nil
}

log.Debugf("Received reservation %x",
reservationRes.ReservationId)
_, err := m.newReservation(
Expand Down
Loading