Skip to content

Commit

Permalink
[#888] incr instanceCount in once and fmt codes (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
aireet authored Oct 17, 2022
1 parent b3ede3a commit 43186ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,7 @@ func (dc *defaultConsumer) start() error {
retryTopic := internal.GetRetryTopic(dc.consumerGroup)
sub := buildSubscriptionData(retryTopic, MessageSelector{TAG, _SubAll})
dc.subscriptionDataTable.Store(retryTopic, sub)
}

if dc.model == Clustering {
dc.option.ChangeInstanceNameToPID()
dc.storage = NewRemoteOffsetStore(dc.consumerGroup, dc.client, dc.client.GetNameSrv())
} else {
Expand Down
4 changes: 3 additions & 1 deletion internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,10 @@ func GetOrNewRocketMQClient(option ClientOptions, callbackCh chan interface{}) R
func (c *rmqClient) Start() {
//ctx, cancel := context.WithCancel(context.Background())
//c.cancel = cancel
atomic.AddInt32(&c.instanceCount, 1)
c.once.Do(func() {

atomic.AddInt32(&c.instanceCount, 1)

if !c.option.Credentials.IsEmpty() {
c.remoteClient.RegisterInterceptor(remote.ACLInterceptor(c.option.Credentials))
}
Expand Down

0 comments on commit 43186ad

Please sign in to comment.