Commit 016ac37d authored by Steven Allen's avatar Steven Allen

only visit nodes in EnumerateChildrenAsync when asked

No idea why this was changed this was introduced in:

08f342e8bada4f4eb0c5462a3623f0c2b828240f (part of #3598)

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent 0ffc5834
......@@ -319,17 +319,17 @@ func EnumerateChildrenAsync(ctx context.Context, getLinks GetLinks, c *cid.Cid,
for i := 0; i < FetchGraphConcurrency; i++ {
go func() {
for ic := range feed {
setlk.Lock()
shouldVisit := visit(ic)
setlk.Unlock()
if shouldVisit {
links, err := getLinks(ctx, ic)
if err != nil {
errChan <- err
return
}
setlk.Lock()
unseen := visit(ic)
setlk.Unlock()
if unseen {
select {
case out <- links:
case <-fetchersCtx.Done():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment