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-pinner
Commits
3bd4a4b0
Commit
3bd4a4b0
authored
10 years ago
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teach pinning how to use GetBlocks
parent
8a3c8f75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
pin.go
pin.go
+6
-2
No files found.
pin.go
View file @
3bd4a4b0
...
...
@@ -7,7 +7,9 @@ import (
"errors"
"fmt"
"sync"
"time"
context
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
ds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
nsds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/namespace"
"github.com/jbenet/go-ipfs/blocks/set"
...
...
@@ -170,8 +172,10 @@ func (p *pinner) pinIndirectRecurse(node *mdag.Node) error {
}
func
(
p
*
pinner
)
pinLinks
(
node
*
mdag
.
Node
)
error
{
for
_
,
l
:=
range
node
.
Links
{
subnode
,
err
:=
l
.
GetNode
(
p
.
dserv
)
ctx
,
_
:=
context
.
WithTimeout
(
context
.
Background
(),
time
.
Second
*
60
)
for
_
,
ng
:=
range
p
.
dserv
.
GetDAG
(
ctx
,
node
)
{
subnode
,
err
:=
ng
.
Get
()
//subnode, err := l.GetNode(p.dserv)
if
err
!=
nil
{
// TODO: Maybe just log and continue?
return
err
...
...
This diff is collapsed.
Click to expand it.
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