Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
szh
chain33-pai
Commits
f3fb3b7a
Commit
f3fb3b7a
authored
Dec 26, 2019
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
841a6533
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
process.go
pkg/app/process.go
+17
-5
No files found.
pkg/app/process.go
View file @
f3fb3b7a
...
@@ -18,7 +18,6 @@ import (
...
@@ -18,7 +18,6 @@ import (
"io/ioutil"
"io/ioutil"
"chain33-pai/pkg/util"
"chain33-pai/pkg/util"
"chain33-pai/pkg/e"
"chain33-pai/pkg/e"
"chain33-pai/pkg/chain33"
)
)
type
ProcessInfo
struct
{
type
ProcessInfo
struct
{
...
@@ -352,13 +351,25 @@ func GetAbsPath(key string) string {
...
@@ -352,13 +351,25 @@ func GetAbsPath(key string) string {
}
}
func
SafeCloseNode
()
(
bool
,
error
)
{
func
SafeCloseNode
()
(
bool
,
error
)
{
var
client
chain33
.
PaiClient
//var client chain33.PaiClient
reply
,
err
:=
client
.
Close
()
//reply,err := client.Close()
//if err != nil {
// return false,err
//}
//if !reply.IsOk {
// return false,nil
//}
//return true,nil
close
:=
exec
.
Command
(
setting
.
BityuanSetting
.
Name
+
"-cli"
,
"close"
)
stderr
:=
bytes
.
NewBuffer
(
nil
)
close
.
Stderr
=
stderr
err
:=
close
.
Start
()
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
if
!
reply
.
IsOk
{
err
=
close
.
Wait
()
return
false
,
nil
if
err
!=
nil
{
return
false
,
errors
.
New
(
stderr
.
String
())
}
}
return
true
,
nil
return
true
,
nil
}
}
\ No newline at end of file
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