mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-05-28 13:41:20 +00:00
Use res.NextSync() instead of res.Next() to avoid using a channel.
This commit is contained in:
parent
a72dd86fa6
commit
ce68333cce
@ -118,7 +118,11 @@ func loadProvSet(dstore ds.Datastore, k *cid.Cid) (*providerSet, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
out := newProviderSet()
|
out := newProviderSet()
|
||||||
for e := range res.Next() {
|
for {
|
||||||
|
e, ok := res.NextSync()
|
||||||
|
if !ok {
|
||||||
|
break
|
||||||
|
}
|
||||||
if e.Error != nil {
|
if e.Error != nil {
|
||||||
log.Error("got an error: ", e.Error)
|
log.Error("got an error: ", e.Error)
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user