mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +08:00
Merge pull request #3703 from ipfs/fix/format-in-merkledag
Fix formatting in merkledag.go
This commit is contained in:
@ -399,12 +399,12 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
|
|||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
|
|
||||||
var setlk sync.Mutex
|
var setlk sync.Mutex
|
||||||
|
|
||||||
errChan := make(chan error)
|
errChan := make(chan error)
|
||||||
fetchersCtx, cancel := context.WithCancel(ctx)
|
fetchersCtx, cancel := context.WithCancel(ctx)
|
||||||
|
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
for i := 0; i < FetchGraphConcurrency; i++ {
|
for i := 0; i < FetchGraphConcurrency; i++ {
|
||||||
go func() {
|
go func() {
|
||||||
for ic := range feed {
|
for ic := range feed {
|
||||||
@ -413,11 +413,11 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
|
|||||||
errChan <- err
|
errChan <- err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
setlk.Lock()
|
setlk.Lock()
|
||||||
unseen := visit(ic)
|
unseen := visit(ic)
|
||||||
setlk.Unlock()
|
setlk.Unlock()
|
||||||
|
|
||||||
if unseen {
|
if unseen {
|
||||||
select {
|
select {
|
||||||
case out <- n:
|
case out <- n:
|
||||||
@ -466,7 +466,7 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
|
|||||||
}
|
}
|
||||||
case err := <-errChan:
|
case err := <-errChan:
|
||||||
return err
|
return err
|
||||||
|
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return ctx.Err()
|
return ctx.Err()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user