fix(executor/local): check processState nil
All checks were successful
submodules sync / sync (push) Successful in 44s
build / build (push) Successful in 2m1s
build / trigger-build-image (push) Successful in 11s

This commit is contained in:
张泊明518370910136 2025-03-21 02:53:16 -04:00
parent a53cb6451e
commit 14961db8f0
GPG Key ID: D47306D7062CDA9D

View File

@ -23,11 +23,16 @@ func (e *Local) generateResult(
isTimeout bool,
) stage.ExecutorResult {
result := stage.ExecutorResult{
Status: stage.StatusAccepted,
ExitStatus: processState.ExitCode(),
Error: "",
Status: stage.StatusAccepted,
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 {