Commit af4ae9ae authored by Jeromy's avatar Jeromy

add context to blockservice Get

parent d45513e0
...@@ -2,6 +2,9 @@ package merkledag ...@@ -2,6 +2,9 @@ package merkledag
import ( import (
"fmt" "fmt"
"time"
"code.google.com/p/go.net/context"
mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash" mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
blocks "github.com/jbenet/go-ipfs/blocks" blocks "github.com/jbenet/go-ipfs/blocks"
...@@ -204,7 +207,8 @@ func (n *DAGService) Get(k u.Key) (*Node, error) { ...@@ -204,7 +207,8 @@ func (n *DAGService) Get(k u.Key) (*Node, error) {
return nil, fmt.Errorf("DAGService is nil") return nil, fmt.Errorf("DAGService is nil")
} }
b, err := n.Blocks.GetBlock(k) ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
b, err := n.Blocks.GetBlock(ctx, k)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment