Skip to content

Commit

Permalink
Inline kafkalib.batched (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie authored Oct 18, 2024
1 parent caad3d1 commit 106c9d9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 44 deletions.
8 changes: 0 additions & 8 deletions lib/kafkalib/batch.go

This file was deleted.

35 changes: 0 additions & 35 deletions lib/kafkalib/batch_test.go

This file was deleted.

3 changes: 2 additions & 1 deletion lib/kafkalib/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"log/slog"
"slices"
"time"

"github.com/artie-labs/transfer/lib/jitter"
Expand Down Expand Up @@ -99,7 +100,7 @@ func (b *BatchWriter) Write(ctx context.Context, rawMsgs []lib.RawMessage) error
msgs = append(msgs, kafkaMsg)
}

for _, batch := range batched(msgs, int(b.cfg.GetPublishSize())) {
for batch := range slices.Chunk(msgs, int(b.cfg.GetPublishSize())) {
tags := map[string]string{
"what": "error",
}
Expand Down

0 comments on commit 106c9d9

Please sign in to comment.