Skip to content

Commit

Permalink
Update writeAPIBlocking.go
Browse files Browse the repository at this point in the history
Commit a9c1e37 introduced a bug, where a successful `Flush` returns a non-nil error because the internal function (`w.service.WriteBatch`) returns a concrete pointer and not an `error`.
  • Loading branch information
danielorbach authored Oct 18, 2022
1 parent 6bd9713 commit c652561
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/writeAPIBlocking.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ func (w *writeAPIBlocking) flush(ctx context.Context) error {
body := strings.Join(w.batch, "\n")
w.batch = w.batch[:0]
b := iwrite.NewBatch(body, w.writeOptions.MaxRetryTime())
return w.service.WriteBatch(ctx, b)
if err:= w.service.WriteBatch(ctx, b); err != nil {
return err
}
}
return nil
}
Expand Down

0 comments on commit c652561

Please sign in to comment.