fix
This commit is contained in:
parent
dc1feac378
commit
c03854b6d1
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
"service/library/configcenter"
|
||||
"service/library/servicediscovery"
|
||||
|
@ -93,11 +94,17 @@ func registerSD(ip string, port int) error {
|
|||
}
|
||||
|
||||
func setServerStatusFD(status string) {
|
||||
os.Setenv("SERVER_STATUS_FD", status)
|
||||
fmt.Println(os.Getenv("SERVER_STATUS_FD"))
|
||||
serverStatusFdPath := "/Users/erwin/SERVER_STATUS_FD"
|
||||
cmd := exec.Command("echo", fmt.Sprintf("%s > %s", status, serverStatusFdPath))
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
logger.Info("run cmd fail, p: %v, err: %v", serverStatusFdPath, err)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
serverStatusFdPath := "/Users/erwin/SERVER_STATUS_FD"
|
||||
serverStatusFdPath = "/Users/erwin/SERVER_STATUS_FD"
|
||||
file, err := os.OpenFile(serverStatusFdPath, os.O_RDWR|os.O_CREATE, 0666)
|
||||
if err != nil {
|
||||
logger.Info("OpenFile fail, p: %v, err: %v", serverStatusFdPath, err)
|
||||
|
|
Loading…
Reference in New Issue