Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
8417818a
Unverified
Commit
8417818a
authored
Jul 24, 2019
by
Steven Allen
Committed by
GitHub
Jul 24, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6505 from ipfs/fix/slightly-faster-gc
fix: slightly faster gc
parents
876d5ba1
41f301a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
core/commands/pin.go
core/commands/pin.go
+1
-1
core/coreapi/pin.go
core/coreapi/pin.go
+1
-1
pin/gc/gc.go
pin/gc/gc.go
+1
-1
No files found.
core/commands/pin.go
View file @
8417818a
...
...
@@ -503,7 +503,7 @@ func pinLsAll(req *cmds.Request, typeStr string, n *core.IpfsNode, emit func(val
if
typeStr
==
"indirect"
||
typeStr
==
"all"
{
for
_
,
k
:=
range
n
.
Pinning
.
RecursiveKeys
()
{
var
visitErr
error
err
:=
dag
.
WalkDepth
(
req
.
Context
,
dag
.
GetLinksWithDAG
(
n
.
DAG
),
k
,
0
,
func
(
c
cid
.
Cid
,
depth
int
)
bool
{
err
:=
dag
.
Walk
Parallel
Depth
(
req
.
Context
,
dag
.
GetLinksWithDAG
(
n
.
DAG
),
k
,
0
,
func
(
c
cid
.
Cid
,
depth
int
)
bool
{
if
depth
==
0
{
// skip it without visiting it.
return
true
...
...
core/coreapi/pin.go
View file @
8417818a
...
...
@@ -209,7 +209,7 @@ func (api *PinAPI) pinLsAll(typeStr string, ctx context.Context) ([]coreiface.Pi
if
typeStr
==
"indirect"
||
typeStr
==
"all"
{
set
:=
cid
.
NewSet
()
for
_
,
k
:=
range
api
.
pinning
.
RecursiveKeys
()
{
err
:=
merkledag
.
WalkDepth
(
err
:=
merkledag
.
Walk
Parallel
Depth
(
ctx
,
merkledag
.
GetLinksWithDAG
(
api
.
dag
),
k
,
0
,
func
(
c
cid
.
Cid
,
depth
int
)
bool
{
// don't visit the root node, that doesn't count.
...
...
pin/gc/gc.go
View file @
8417818a
...
...
@@ -171,7 +171,7 @@ func Descendants(ctx context.Context, getLinks dag.GetLinks, set *cid.Set, roots
for
_
,
c
:=
range
roots
{
// Walk recursively walks the dag and adds the keys to the given set
err
:=
dag
.
Walk
(
ctx
,
verifyGetLinks
,
c
,
set
.
Visit
)
err
:=
dag
.
Walk
Parallel
(
ctx
,
verifyGetLinks
,
c
,
set
.
Visit
)
if
err
!=
nil
{
err
=
verboseCidError
(
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment