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-dms3
Commits
307c5423
Commit
307c5423
authored
Apr 16, 2017
by
Jeromy Johnson
Committed by
GitHub
Apr 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3864 from timthelion/refactor/use-ctx-var-consistently
Refactor: use ctx var consistently in daemon.go
parents
1c50ec0c
739a62e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
cmd/ipfs/daemon.go
cmd/ipfs/daemon.go
+4
-4
No files found.
cmd/ipfs/daemon.go
View file @
307c5423
...
...
@@ -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
{
...
...
@@ -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
)
...
...
@@ -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
...
...
@@ -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
}
...
...
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