mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix looping
This commit is contained in:
parent
f5684839a2
commit
bff09fb74f
|
@ -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…
Reference in a new issue