From fff680726c35dda81cfe0e805e0c59feeca7d897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Wed, 24 Jul 2019 12:33:53 +0200 Subject: [PATCH] update to the latest go-merkledag, enable concurrent fetching of the pinset --- go.mod | 2 +- go.sum | 2 ++ simple/reprovide.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c906a70..f319f44 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/ipfs/go-ipld-cbor v0.0.2 github.com/ipfs/go-ipld-format v0.0.2 github.com/ipfs/go-log v0.0.1 - github.com/ipfs/go-merkledag v0.2.0 + github.com/ipfs/go-merkledag v0.2.1 github.com/ipfs/go-verifcid v0.0.1 github.com/libp2p/go-libp2p-core v0.0.3 github.com/libp2p/go-libp2p-testing v0.0.4 diff --git a/go.sum b/go.sum index 54aacec..f45d642 100644 --- a/go.sum +++ b/go.sum @@ -102,6 +102,8 @@ github.com/ipfs/go-log v0.0.1 h1:9XTUN/rW64BCG1YhPK9Hoy3q8nr4gOmHHBpgFdfw6Lc= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-merkledag v0.2.0 h1:EAjIQCgZ6/DnOAlKY3+59j72FD9BsYtNaCRSmN0xIbU= github.com/ipfs/go-merkledag v0.2.0/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= +github.com/ipfs/go-merkledag v0.2.1 h1:rHJeuK6+cRzvY4uA9QMPFq9t6I2DKV0oeaKNecnoeeg= +github.com/ipfs/go-merkledag v0.2.1/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= github.com/ipfs/go-peertaskqueue v0.1.0 h1:bpRbgv76eT4avutNPDFZuCPOQus6qTgurEYxfulgZW4= diff --git a/simple/reprovide.go b/simple/reprovide.go index 590b9d1..33cd6e0 100644 --- a/simple/reprovide.go +++ b/simple/reprovide.go @@ -18,7 +18,7 @@ import ( var logR = logging.Logger("reprovider.simple") -//KeyChanFunc is function streaming CIDs to pass to content routing +// KeyChanFunc is function streaming CIDs to pass to content routing type KeyChanFunc func(context.Context) (<-chan cid.Cid, error) type doneFunc func(error) @@ -216,7 +216,7 @@ func pinSet(ctx context.Context, pinning Pinner, dag ipld.DAGService, onlyRoots if onlyRoots { set.Visitor(ctx)(key) } else { - err := merkledag.Walk(ctx, merkledag.GetLinksWithDAG(dag), key, set.Visitor(ctx)) + err := merkledag.Walk(ctx, merkledag.GetLinksWithDAG(dag), key, set.Visitor(ctx), merkledag.Concurrent(), merkledag.WithRoot()) if err != nil { logR.Errorf("reprovide indirect pins: %s", err) return