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-unixfs
Commits
f74e71f9
Commit
f74e71f9
authored
9 years ago
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ugly error message when killing commands
parent
6036b043
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 @
f74e71f9
...
...
@@ -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..."
)
...
...
This diff is collapsed.
Click to expand it.
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