fix: allow event emitting to happen in parallel with getting the query channel

This commit is contained in:
Adin Schmahmann 2023-11-08 01:09:29 -05:00 committed by Henrique Dias
parent 9371d18b53
commit 846310e5ac

View File

@ -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{