Browse Source

fix looping

pull/1318/head
Chris Lu 5 years ago
parent
commit
bff09fb74f
  1. 6
      weed/messaging/msgclient/subscriber.go

6
weed/messaging/msgclient/subscriber.go

@ -102,10 +102,10 @@ func (s *Subscriber) Subscribe(processFn func(m *messaging_pb.Message)) {
for i := 0; i < len(s.subscriberClients); i++ {
if s.subscriberClients[i] != nil {
wg.Add(1)
go func() {
go func(subscriberClient messaging_pb.SeaweedMessaging_SubscribeClient) {
defer wg.Done()
doSubscribe(s.subscriberClients[i], processFn)
}()
doSubscribe(subscriberClient, processFn)
}(s.subscriberClients[i])
}
}
wg.Wait()

Loading…
Cancel
Save