From c519c4d74cc7c6f9f06a83daf61009279f338d89 Mon Sep 17 00:00:00 2001 From: Nick Z <2420177+nickzelei@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:31:18 -0700 Subject: [PATCH] Fixes issue in parsed config method --- internal/benthos/benthos-builder/builders/sql-util.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/benthos/benthos-builder/builders/sql-util.go b/internal/benthos/benthos-builder/builders/sql-util.go index 0751ca49b6..f9906e60dc 100644 --- a/internal/benthos/benthos-builder/builders/sql-util.go +++ b/internal/benthos/benthos-builder/builders/sql-util.go @@ -633,8 +633,6 @@ func getParsedBatchingConfig(destOpt batchDestinationOption) (batchingConfig, er output.MaxInFlight = destOpt.GetMaxInFlight() } - batchCount := 100 - batchPeriod := "5s" batchConfig := destOpt.GetBatch() if batchConfig != nil { output.BatchCount = int(batchConfig.GetCount()) @@ -648,7 +646,7 @@ func getParsedBatchingConfig(destOpt batchDestinationOption) (batchingConfig, er output.BatchPeriod = batchConfig.GetPeriod() } - if batchCount == 0 && batchPeriod == "" { + if output.BatchCount == 0 && output.BatchPeriod == "" { return batchingConfig{}, fmt.Errorf("must have at least one batch policy configured. Cannot disable both period and count") } return output, nil