Commit f3fb3b7a authored by szh's avatar szh

up

parent 841a6533
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment