mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-24 20:07:45 +08:00
fix: allow event emitting to happen in parallel with getting the query channel
This commit is contained in:
parent
151624c47b
commit
c6ae7165c8
@ -81,10 +81,9 @@ var findProvidersRoutingCmd = &cmds.Command{
|
||||
ctx, cancel := context.WithCancel(req.Context)
|
||||
ctx, events := routing.RegisterForQueryEvents(ctx)
|
||||
|
||||
pchan := n.Routing.FindProvidersAsync(ctx, c, numProviders)
|
||||
|
||||
go func() {
|
||||
defer cancel()
|
||||
pchan := n.Routing.FindProvidersAsync(ctx, c, numProviders)
|
||||
for p := range pchan {
|
||||
np := p
|
||||
routing.PublishQueryEvent(ctx, &routing.QueryEvent{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user