Skip to content

Commit

Permalink
make sure we always at least poll once on the latest unprocessed id
Browse files Browse the repository at this point in the history
  • Loading branch information
zaibon committed May 6, 2020
1 parent bdf9fbe commit 84a6855
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/provision/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ func (s *pollSource) Reservations(ctx context.Context) <-chan *Reservation {
continue
}

next = lastID + 1
// guard to make sure we always at least poll once on the latest unprocessed id
if len(res) == 0 {
next = lastID
} else {
next = lastID + 1
}

select {
case <-ctx.Done():
Expand Down

0 comments on commit 84a6855

Please sign in to comment.