Skip to content

Commit

Permalink
context background for ProduceSync
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryRomanov committed Jul 18, 2024
1 parent cc6e3cd commit 25e557d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/output/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func (p *Plugin) out(workerData *pipeline.WorkerData, batch *pipeline.Batch) err
i++
})

if err := p.client.ProduceSync(context.TODO(), data.messages[:i]...).FirstErr(); err != nil {
if err := p.client.ProduceSync(context.Background(), data.messages[:i]...).FirstErr(); err != nil {
p.logger.Errorf("can't write batch: %v", err)
p.sendErrorMetric.Inc()
return err
Expand Down

0 comments on commit 25e557d

Please sign in to comment.