From 84a6855327d3b11f3d9cc8b0e7dae47afdf264b1 Mon Sep 17 00:00:00 2001 From: Christophe de Carvalho Date: Wed, 6 May 2020 08:27:36 +0200 Subject: [PATCH] make sure we always at least poll once on the latest unprocessed id --- pkg/provision/source.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/provision/source.go b/pkg/provision/source.go index 86b6d9f31..2a331300a 100644 --- a/pkg/provision/source.go +++ b/pkg/provision/source.go @@ -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():