fix(executor/local): check processState nil
This commit is contained in:
parent
a53cb6451e
commit
14961db8f0
|
@ -23,11 +23,16 @@ func (e *Local) generateResult(
|
||||||
isTimeout bool,
|
isTimeout bool,
|
||||||
) stage.ExecutorResult {
|
) stage.ExecutorResult {
|
||||||
result := stage.ExecutorResult{
|
result := stage.ExecutorResult{
|
||||||
Status: stage.StatusAccepted,
|
Status: stage.StatusAccepted,
|
||||||
ExitStatus: processState.ExitCode(),
|
ExitStatus: func() int {
|
||||||
Error: "",
|
if processState == nil {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
return processState.ExitCode()
|
||||||
|
}(),
|
||||||
|
Error: "",
|
||||||
Time: func() uint64 {
|
Time: func() uint64 {
|
||||||
if isTimeout {
|
if processState == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
nanos := processState.UserTime().Nanoseconds()
|
nanos := processState.UserTime().Nanoseconds()
|
||||||
|
@ -37,6 +42,9 @@ func (e *Local) generateResult(
|
||||||
return uint64(nanos)
|
return uint64(nanos)
|
||||||
}(),
|
}(),
|
||||||
Memory: func() uint64 {
|
Memory: func() uint64 {
|
||||||
|
if processState == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
usage := processState.SysUsage()
|
usage := processState.SysUsage()
|
||||||
rusage, ok := usage.(*syscall.Rusage)
|
rusage, ok := usage.(*syscall.Rusage)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user