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 151624c47b
commit c6ae7165c8
No known key found for this signature in database

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{