Skip to content

Commit

Permalink
Clear batch after processing
Browse files Browse the repository at this point in the history
  • Loading branch information
RMPall committed Oct 21, 2022
1 parent b88fc18 commit e2292bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 335 deletions.
1 change: 1 addition & 0 deletions event/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func ProcessBatch(ctx context.Context, cfg *config.Config, handler Handler, batc
log.Info(ctx, "process batch starts", log.Data{
"batch_size": batch.Size(),
"reason": reason})
defer batch.Clear()
err := handler.Handle(ctx, cfg.ElasticSearchAPIURL, batch.Events())
if err != nil {
log.Error(ctx, "error handling batch", err)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ require (
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/text v0.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading

0 comments on commit e2292bd

Please sign in to comment.