fix: allow event emitting to happen in parallel with getting the query channel
Adin Schmahmann committed
Nov 8, 2023 at 01:09 UTC
846310e5ac98dee29eae1b71bf5ef7e2a022f490
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{