fix waitgroup bug which crashes subscriber
This commit is contained in:
parent
58a70562d8
commit
9f037eafd2
@ -244,9 +244,15 @@ func (s *rpcServer) createSubHandler(sb *subscriber, opts Options) broker.Handle
|
|||||||
fn = opts.SubWrappers[i-1](fn)
|
fn = opts.SubWrappers[i-1](fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.wg.Add(1)
|
if s.wg != nil {
|
||||||
|
s.wg.Add(1)
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer s.wg.Done()
|
if s.wg != nil {
|
||||||
|
defer s.wg.Done()
|
||||||
|
}
|
||||||
|
|
||||||
results <- fn(ctx, &rpcMessage{
|
results <- fn(ctx, &rpcMessage{
|
||||||
topic: sb.topic,
|
topic: sb.topic,
|
||||||
contentType: ct,
|
contentType: ct,
|
||||||
|
Loading…
Reference in New Issue
Block a user