Skip to content

Commit 59d61d6

Browse files
committed
Update batchwriter.go
1 parent 16dc4cd commit 59d61d6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

writers/batchwriter/batchwriter.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ func (w *BatchWriter) worker(ctx context.Context, tableName string, ch <-chan *m
161161
limit.AddSlice(add)
162162
}
163163
if len(toFlush) > 0 || rest != nil || limit.ReachedLimit() {
164-
// flush current batch
165-
send()
164+
if limit.Rows() > 0 {
165+
send()
166+
}
166167
ticker.Reset(w.batchTimeout)
167168
}
168169
for _, sliceToFlush := range toFlush {

0 commit comments

Comments
 (0)