Skip to content

Commit

Permalink
fixed: internalBatchSend issue(#100)
Browse files Browse the repository at this point in the history
Signed-off-by: cyruslo <[email protected]>
  • Loading branch information
cyruslo committed Jul 28, 2024
1 parent 41fbeca commit a2222d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions opengemini/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ type sendBatchWithCB struct {
callback WriteCallback
}

func (s *sendBatchWithCB) Clear() {
s.point = nil
s.callback(fmt.Errorf("sendBatchWithCB timeout"))
}

type dbRp struct {
db string
rp string
Expand Down Expand Up @@ -129,6 +134,9 @@ func (c *client) internalBatchSend(ctx context.Context, database string, rp stri
select {
case <-ctx.Done():
ticker.Stop()
for record := range resource {
record.Clear()
}
return
case <-ticker.C:
needFlush = true
Expand Down

0 comments on commit a2222d4

Please sign in to comment.