From cc24e622a30e62cb6f58595866f3e44437f5f88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Wed, 4 Jan 2023 14:18:41 +0100 Subject: [PATCH] Change wf iterators to treat limit=0 as no limit for consistency --- server/pkg/wfexec/iterator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/pkg/wfexec/iterator.go b/server/pkg/wfexec/iterator.go index 28e5dd38a..22683e564 100644 --- a/server/pkg/wfexec/iterator.go +++ b/server/pkg/wfexec/iterator.go @@ -101,7 +101,8 @@ func (i *genericIterator) Next(ctx context.Context, scope *expr.Vars) (next Step func GenericResourceNextCheck(useLimit bool, ptr, buffSize, total, limit uint, hasMore bool) bool { // if we can go more (inverted)... - if useLimit && ptr+total >= limit { + // Treat limit = 0 the same as no limit (consistent with other bits of the system) + if (useLimit && limit != 0) && ptr+total >= limit { return false }