Merge pull request #5 from gfanton/fix/empty-result

This commit is contained in:
Guilhem Fanton 2022-09-27 16:34:06 +02:00 committed by GitHub
commit f7347cb814
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -362,10 +362,13 @@ func (rp *rendezvousPoint) DiscoverSubscribe(ctx context.Context, ns string, ser
for {
select {
case result, ok := <-regCh:
if !ok {
return
}
ch <- result.Peer
case <-ctx.Done():
return
case result := <-regCh:
ch <- result.Peer
}
}
}()