Skip to content

Commit

Permalink
Fixes issue in parsed config method
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzelei committed Oct 31, 2024
1 parent d5179cd commit c519c4d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/benthos/benthos-builder/builders/sql-util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down

0 comments on commit c519c4d

Please sign in to comment.