Skip to content

Commit

Permalink
fix: batch channel not close when client close issue(#100)
Browse files Browse the repository at this point in the history
Signed-off-by: cyruslo <[email protected]>
Signed-off-by: ZhangJian He <[email protected]>
Co-authored-by: ZhangJian He <[email protected]>
Signed-off-by: ZhangJian He <[email protected]>
  • Loading branch information
cyruslo and shoothzj committed Aug 4, 2024
1 parent 13fba1e commit b27dcfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opengemini/client_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func newClient(c *Config) (Client, error) {
func (c *client) Close() error {
c.batchContextCancel()
c.dataChanMap.Range(func(key, value interface{}) bool {
cb, ok := value.(chan *sendBatchWithCB)
if ok {
close(cb)
}
c.dataChanMap.Delete(key)
return true
})
Expand Down

0 comments on commit b27dcfa

Please sign in to comment.