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
730b00bf
Commit
730b00bf
authored
Apr 12, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1064 from ipfs/fix/interupt-error
fix ugly error message when killing commands
parents
97e1c953
f74e71f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
cmd/ipfs/main.go
cmd/ipfs/main.go
+15
-13
No files found.
cmd/ipfs/main.go
View file @
730b00bf
...
...
@@ -496,22 +496,24 @@ func (i *cmdInvocation) setupInterruptHandler() {
case
<-
ctx
.
InitDone
:
}
// TODO cancel the command context instead
n
,
err
:=
ctx
.
GetNode
()
if
err
!=
nil
{
log
.
Error
(
err
)
fmt
.
Println
(
shutdownMessage
)
os
.
Exit
(
-
1
)
}
switch
count
{
case
0
:
fmt
.
Println
(
shutdownMessage
)
go
func
()
{
n
.
Close
()
log
.
Info
(
"Gracefully shut down."
)
}()
if
ctx
.
Online
{
go
func
()
{
// TODO cancel the command context instead
n
,
err
:=
ctx
.
GetNode
()
if
err
!=
nil
{
log
.
Error
(
err
)
fmt
.
Println
(
shutdownMessage
)
os
.
Exit
(
-
1
)
}
n
.
Close
()
log
.
Info
(
"Gracefully shut down."
)
}()
}
else
{
os
.
Exit
(
0
)
}
default
:
fmt
.
Println
(
"Received another interrupt before graceful shutdown, terminating..."
)
...
...
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