Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
barry cho
Lepus
Commits
af74497d
Commit
af74497d
authored
3 years ago
by
ruyi
Browse files
Options
Download
Email Patches
Plain Diff
支持windows task调试
parent
1eceabe8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lepus_task/lepus_task.go
+9
-2
src/lepus_task/lepus_task.go
with
9 additions
and
2 deletions
+9
-2
src/lepus_task/lepus_task.go
+
9
-
2
View file @
af74497d
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help