Skip to content

Commit

Permalink
FindProvidersAsync respects cancelation is request not sent yet
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Nov 27, 2024
1 parent 1cefd53 commit da0117e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions routing/providerquerymanager/providerquerymanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ func (pqm *ProviderQueryManager) FindProvidersAsync(sessionCtx context.Context,
close(ch)
span.End()
return ch
case <-sessionCtx.Done():
ch := make(chan peer.AddrInfo)
close(ch)
return ch
}

// DO NOT select on sessionCtx. We only want to abort here if we're
Expand Down

0 comments on commit da0117e

Please sign in to comment.