Skip to content
This repository was archived by the owner on Aug 31, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions dialout/dialout_client/dialout_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,13 @@ func DialOutRun(ctx context.Context, ccfg *ClientConfig) error {
}

for {
// Check if ctx was canceled.
select {
case <-ctx.Done():
return ctx.Err()
default:
}

msgi, err := pubsub.ReceiveTimeout(time.Millisecond * 1000)
if err != nil {
neterr, ok := err.(net.Error)
Expand All @@ -717,11 +724,5 @@ func DialOutRun(ctx context.Context, ccfg *ClientConfig) error {
log.V(2).Infof("Invalid psubscribe payload notification: %v", subscr)
continue
}
// Check if ctx was canceled.
select {
case <-ctx.Done():
return ctx.Err()
default:
}
}
}