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
dfe2b167
Commit
dfe2b167
authored
Mar 07, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmds/id: use req context -- dont timeout unnecessarily
commands should last as long as the user keeps the cmd going
parent
aa55eebe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
core/commands/id.go
core/commands/id.go
+1
-4
No files found.
core/commands/id.go
View file @
dfe2b167
...
...
@@ -7,10 +7,8 @@ import (
"errors"
"io"
"strings"
"time"
b58
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
cmds
"github.com/jbenet/go-ipfs/commands"
core
"github.com/jbenet/go-ipfs/core"
...
...
@@ -81,14 +79,13 @@ ipfs id supports the format option for output with the following keys:
return
}
ctx
,
_
:=
context
.
WithTimeout
(
context
.
TODO
(),
time
.
Second
*
5
)
// TODO handle offline mode with polymorphism instead of conditionals
if
!
node
.
OnlineMode
()
{
res
.
SetError
(
errors
.
New
(
offlineIdErrorMessage
),
cmds
.
ErrClient
)
return
}
p
,
err
:=
node
.
Routing
.
FindPeer
(
ctx
,
id
)
p
,
err
:=
node
.
Routing
.
FindPeer
(
req
.
Context
()
.
Context
,
id
)
if
err
==
kb
.
ErrLookupFailure
{
res
.
SetError
(
errors
.
New
(
offlineIdErrorMessage
),
cmds
.
ErrClient
)
return
...
...
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