1
0
forked from JOJ/JOJ3

feat(parser/resultstatus): conf force quit on not accepted

This commit is contained in:
张泊明518370910136 2024-11-01 18:39:36 -04:00
parent fc86f93dc9
commit fa649fcabe
Signed by untrusted user: 张泊明518370910136
GPG Key ID: D47306D7062CDA9D

View File

@ -10,6 +10,7 @@ import (
type Conf struct { type Conf struct {
Score int Score int
Comment string Comment string
ForceQuitOnNotAccepted bool `default:"false"`
} }
type ResultStatus struct{} type ResultStatus struct{}
@ -31,8 +32,10 @@ func (*ResultStatus) Run(results []stage.ExecutorResult, confAny any) (
comment = fmt.Sprintf( comment = fmt.Sprintf(
"Unexpected executor status: %s.", result.Status, "Unexpected executor status: %s.", result.Status,
) )
if conf.ForceQuitOnNotAccepted {
forceQuit = true forceQuit = true
} }
}
res = append(res, stage.ParserResult{ res = append(res, stage.ParserResult{
Score: score, Score: score,
Comment: comment, Comment: comment,