Fix high cpu usage in singlenode

Signed-off-by: sunby <bingyi.sun@zilliz.com>
This commit is contained in:
sunby 2021-03-29 17:48:15 +08:00 committed by yefu.chen
parent 7ceb9e4a81
commit f8e879b423

View File

@ -93,8 +93,8 @@ func (c *client) Subscribe(options ConsumerOptions) (Consumer, error) {
}
func consume(ctx context.Context, consumer *consumer) {
for { //nolint:gosimple
select { //nolint:gosimple
for {
select {
case <-ctx.Done():
log.Debug("client finished")
return
@ -126,7 +126,6 @@ func consume(ctx context.Context, consumer *consumer) {
Payload: msg[0].Payload,
}
}
default:
}
}
}