Skip to content

Commit

Permalink
Merge pull request ipfs/kubo#6162 from ipfs/feat/dig
Browse files Browse the repository at this point in the history
DI-based core.NewNode

This commit was moved from ipfs/kubo@c3a7bc2
  • Loading branch information
Stebalien authored Apr 18, 2019
2 parents 7b38742 + 6077854 commit f0387ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions gateway/core/corehttp/corehttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func Serve(node *core.IpfsNode, lis net.Listener, options ...ServeOption) error
}

select {
case <-node.Process().Closing():
case <-node.Process.Closing():
return fmt.Errorf("failed to start server, process closing")
default:
}
Expand All @@ -95,15 +95,15 @@ func Serve(node *core.IpfsNode, lis net.Listener, options ...ServeOption) error
}

var serverError error
serverProc := node.Process().Go(func(p goprocess.Process) {
serverProc := node.Process.Go(func(p goprocess.Process) {
serverError = server.Serve(lis)
})

// wait for server to exit.
select {
case <-serverProc.Closed():
// if node being closed before server exits, close server
case <-node.Process().Closing():
case <-node.Process.Closing():
log.Infof("server at %s terminating...", addr)

warnProc := periodicproc.Tick(5*time.Second, func(_ goprocess.Process) {
Expand Down
3 changes: 2 additions & 1 deletion gateway/core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/dagutils"
"github.com/ipfs/go-ipfs/namesys/resolve"

"github.com/dustin/go-humanize"
"github.com/ipfs/go-cid"
Expand Down Expand Up @@ -423,7 +424,7 @@ func (i *gatewayHandler) putHandler(w http.ResponseWriter, r *http.Request) {
}

var newcid cid.Cid
rnode, err := core.Resolve(ctx, i.node.Namesys, i.node.Resolver, rootPath)
rnode, err := resolve.Resolve(ctx, i.node.Namesys, i.node.Resolver, rootPath)
switch ev := err.(type) {
case resolver.ErrNoLink:
// ev.Node < node where resolve failed
Expand Down

0 comments on commit f0387ae

Please sign in to comment.