Commit af74497d authored by ruyi's avatar ruyi
Browse files

支持windows task调试

parent 1eceabe8
Showing with 9 additions and 2 deletions
+9 -2
......@@ -129,7 +129,14 @@ func runTaskCmd(runId, taskId, taskName, taskCommand, timeout string) {
var (
status, logContent string
)
//sysType := runtime.GOOS
//var execType string
//if sysType == "linux" {
// execType = "/bin/sh"
//}
//if sysType == "windows" {
// execType = "cmd"
//}
cmd := exec.Command("/bin/sh", "-c", taskCommand)
var out bytes.Buffer
cmd.Stdout = &out
......@@ -166,7 +173,7 @@ func runTaskCmd(runId, taskId, taskName, taskCommand, timeout string) {
case err := <-errorChan:
status = "failed"
logContent = fmt.Sprint(err)
log.Error(fmt.Sprintf("Task %s execute command finished with err:%s", taskName, err))
log.Error(fmt.Sprintf("Task %s execute command finished with err:%s, %s", taskName, err, out.String()))
}
}
mysql.Execute(db, fmt.Sprintf("update task_run set run_status='%s',run_end_time='%s' where id='%s' ", status, utils.GetCurrentTime(), runId))
......
Supports Markdown
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