fix: 重启信号

This commit is contained in:
TsMask
2024-03-21 10:45:25 +08:00
parent 399e7c2dad
commit 8baca65cc1

View File

@@ -241,15 +241,13 @@ func (s *SystemController) RebootApp(c *gin.Context) {
return return
} }
_, err := cmd.ExecWithCheck("nohup", "sh", "-c", "sleep 2s && service omc restart", "> /dev/null 2>&1 &\n") go func() {
if err != nil { _, err := cmd.ExecWithCheck("nohup", "sh", "-c", "sleep 2s && service omc restart", "> /dev/null 2>&1 &\n")
c.JSON(200, map[string]any{ if err != nil {
"requestId": body.RequestId, fmt.Println(fmt.Sprintf("NE service reboot error %s", err.Error()))
"status": "fail", return
"additionalInfo": fmt.Sprintf("NE service reboot error %s", err.Error()), }
}) }()
return
}
c.JSON(200, map[string]any{ c.JSON(200, map[string]any{
"requestId": body.RequestId, "requestId": body.RequestId,