fix: allow event emitting to happen in parallel with getting the query channel
Adin Schmahmann committed
Nov 8, 2023 at 01:09 UTC
c6ae7165c8e23b6cedde7c986e19d2fc35efb2a8
1 file changed
+1
-2
core/commands/routing.go
+1
-2
@@ -81,10 +81,9 @@ var findProvidersRoutingCmd = &cmds.Command{
81
ctx, cancel := context.WithCancel(req.Context)
82
ctx, events := routing.RegisterForQueryEvents(ctx)
83
84
- pchan := n.Routing.FindProvidersAsync(ctx, c, numProviders)
85
-
84
go func() {
85
defer cancel()
86
+ pchan := n.Routing.FindProvidersAsync(ctx, c, numProviders)
87
for p := range pchan {
88
np := p
89
routing.PublishQueryEvent(ctx, &routing.QueryEvent{