feat(parser/resultstatus): 0 score on non-accepted status
All checks were successful
submodules sync / sync (push) Successful in 42s
build / build (push) Successful in 1m26s
build / trigger-build-image (push) Successful in 7s

This commit is contained in:
张泊明518370910136 2024-11-01 03:08:20 -04:00
parent 12f2c93fb8
commit 6a7787a974
GPG Key ID: D47306D7062CDA9D

View File

@ -21,18 +21,20 @@ func (*ResultStatus) Run(results []stage.ExecutorResult, confAny any) (
if err != nil {
return nil, true, err
}
score := conf.Score
forceQuit := false
var res []stage.ParserResult
for _, result := range results {
comment := conf.Comment
if result.Status != stage.Status(envexec.StatusAccepted) {
forceQuit = true
score = 0
comment = fmt.Sprintf(
"Unexpected executor status: %s.", result.Status,
)
forceQuit = true
}
res = append(res, stage.ParserResult{
Score: conf.Score,
Score: score,
Comment: comment,
})
}