Skip to content

Commit

Permalink
Refactor BatchHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
minhduc140583 committed Jun 30, 2024
1 parent 8104d8a commit 70b5ee4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions batch_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ func (h *BatchHandler[T]) Handle(ctx context.Context, data []Message[T]) ([]Mess
vs = append(vs, message.Value)
}
failIndices, err := h.Write(ctx, vs)
if err != nil {
return failMessages, err
}
sl := len(failIndices)
if sl > 0 {
for j := 0; j < sl; j++ {
failMessages = append(failMessages, data[failIndices[j]])
}
}
return failMessages, err
}
return failMessages, nil
}

0 comments on commit 70b5ee4

Please sign in to comment.