Skip to content

Commit ab4d0f0

Browse files
Only appened response status if request.wait()
1 parent 2044042 commit ab4d0f0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

channel.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ func (ch *Channel) call(ctx context.Context, req message, res ...message) error
183183
return err
184184
}
185185

186-
var status uint32
186+
if req.wait() {
187+
var status uint32
187188

188-
ch.responsesM.Lock()
189-
ch.responses = append(ch.responses, &status)
190-
ch.responsesM.Unlock()
189+
ch.responsesM.Lock()
190+
ch.responses = append(ch.responses, &status)
191+
ch.responsesM.Unlock()
191192

192-
if req.wait() {
193193
select {
194194
case <-ctx.Done():
195195
atomic.StoreUint32(&status, 1)

0 commit comments

Comments
 (0)