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-unixfs
Commits
da1062c9
Commit
da1062c9
authored
May 19, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change pinning to happen in a callback
parent
36d50ca7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
mod/dagmodifier.go
mod/dagmodifier.go
+2
-1
mod/dagmodifier_test.go
mod/dagmodifier_test.go
+1
-1
No files found.
mod/dagmodifier.go
View file @
da1062c9
...
@@ -11,6 +11,7 @@ import (
...
@@ -11,6 +11,7 @@ import (
mh
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
mh
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
imp
"github.com/ipfs/go-ipfs/importer"
chunk
"github.com/ipfs/go-ipfs/importer/chunk"
chunk
"github.com/ipfs/go-ipfs/importer/chunk"
help
"github.com/ipfs/go-ipfs/importer/helpers"
help
"github.com/ipfs/go-ipfs/importer/helpers"
trickle
"github.com/ipfs/go-ipfs/importer/trickle"
trickle
"github.com/ipfs/go-ipfs/importer/trickle"
...
@@ -308,7 +309,7 @@ func (dm *DagModifier) appendData(node *mdag.Node, blks <-chan []byte) (*mdag.No
...
@@ -308,7 +309,7 @@ func (dm *DagModifier) appendData(node *mdag.Node, blks <-chan []byte) (*mdag.No
dbp
:=
&
help
.
DagBuilderParams
{
dbp
:=
&
help
.
DagBuilderParams
{
Dagserv
:
dm
.
dagserv
,
Dagserv
:
dm
.
dagserv
,
Maxlinks
:
help
.
DefaultLinksPerBlock
,
Maxlinks
:
help
.
DefaultLinksPerBlock
,
Pinner
:
dm
.
mp
,
BlockCB
:
imp
.
Basic
Pinner
CB
(
dm
.
mp
)
,
}
}
return
trickle
.
TrickleAppend
(
node
,
dbp
.
New
(
blks
))
return
trickle
.
TrickleAppend
(
node
,
dbp
.
New
(
blks
))
...
...
mod/dagmodifier_test.go
View file @
da1062c9
...
@@ -52,7 +52,7 @@ func getMockDagServAndBstore(t testing.TB) (mdag.DAGService, blockstore.Blocksto
...
@@ -52,7 +52,7 @@ func getMockDagServAndBstore(t testing.TB) (mdag.DAGService, blockstore.Blocksto
func
getNode
(
t
testing
.
TB
,
dserv
mdag
.
DAGService
,
size
int64
,
pinner
pin
.
ManualPinner
)
([]
byte
,
*
mdag
.
Node
)
{
func
getNode
(
t
testing
.
TB
,
dserv
mdag
.
DAGService
,
size
int64
,
pinner
pin
.
ManualPinner
)
([]
byte
,
*
mdag
.
Node
)
{
in
:=
io
.
LimitReader
(
u
.
NewTimeSeededRand
(),
size
)
in
:=
io
.
LimitReader
(
u
.
NewTimeSeededRand
(),
size
)
node
,
err
:=
imp
.
BuildTrickleDagFromReader
(
in
,
dserv
,
pinner
,
&
chunk
.
SizeSplitter
{
500
})
node
,
err
:=
imp
.
BuildTrickleDagFromReader
(
in
,
dserv
,
&
chunk
.
SizeSplitter
{
500
}
,
imp
.
BasicPinnerCB
(
pinner
)
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
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