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