This is an automated email from the ASF dual-hosted git repository.
wenfeng pushed a commit to branch native
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git
The following commit(s) were added to refs/heads/native by this push:
new 320d965 fix: lock is extra when not orderly consume (#393)
320d965 is described below
commit 320d9652a05e166fa5167b837dfc0b31d3d957c1
Author: xujianhai666 <[email protected]>
AuthorDate: Wed Jan 22 16:27:08 2020 +0800
fix: lock is extra when not orderly consume (#393)
Closes #365
---
consumer/push_consumer.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/consumer/push_consumer.go b/consumer/push_consumer.go
index a593239..79f22f5 100644
--- a/consumer/push_consumer.go
+++ b/consumer/push_consumer.go
@@ -168,6 +168,10 @@ func (pc *pushConsumer) Start() error {
go primitive.WithRecover(func() {
// initial lock.
+ if !pc.consumeOrderly {
+ return
+ }
+
time.Sleep(1000 * time.Millisecond)
pc.lockAll()