Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: use ctx var consistently in daemon.go #3864

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {

if initialize {

cfg := req.InvocContext().ConfigRoot
cfg := ctx.ConfigRoot
if !fsrepo.IsInitialized(cfg) {
err := initWithDefaults(os.Stdout, cfg)
if err != nil {
Expand All @@ -238,7 +238,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {

// acquire the repo lock _before_ constructing a node. we need to make
// sure we are permitted to access the resources (datastore, etc.)
repo, err := fsrepo.Open(req.InvocContext().ConfigRoot)
repo, err := fsrepo.Open(ctx.ConfigRoot)
switch err {
default:
res.SetError(err, cmds.ErrNormal)
Expand Down Expand Up @@ -268,7 +268,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
return
}

repo, err = fsrepo.Open(req.InvocContext().ConfigRoot)
repo, err = fsrepo.Open(ctx.ConfigRoot)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
Expand Down Expand Up @@ -359,7 +359,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
}
}()

req.InvocContext().ConstructNode = func() (*core.IpfsNode, error) {
ctx.ConstructNode = func() (*core.IpfsNode, error) {
return node, nil
}

Expand Down