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-merkledag
Commits
513740f9
Commit
513740f9
authored
Mar 23, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix context respect through fuse reading
parent
a83cbb99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
merkledag.go
merkledag.go
+4
-2
No files found.
merkledag.go
View file @
513740f9
...
...
@@ -257,10 +257,10 @@ type nodePromise struct {
// from its internal channels, subsequent calls will return the
// cached node.
type
NodeGetter
interface
{
Get
()
(
*
Node
,
error
)
Get
(
context
.
Context
)
(
*
Node
,
error
)
}
func
(
np
*
nodePromise
)
Get
()
(
*
Node
,
error
)
{
func
(
np
*
nodePromise
)
Get
(
ctx
context
.
Context
)
(
*
Node
,
error
)
{
if
np
.
cache
!=
nil
{
return
np
.
cache
,
nil
}
...
...
@@ -270,6 +270,8 @@ func (np *nodePromise) Get() (*Node, error) {
np
.
cache
=
blk
case
<-
np
.
ctx
.
Done
()
:
return
nil
,
np
.
ctx
.
Err
()
case
<-
ctx
.
Done
()
:
return
nil
,
ctx
.
Err
()
}
return
np
.
cache
,
nil
}
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