chore(parser/healthcheck): more logs
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 1m15s
build / trigger-build-image (push) Successful in 7s

This commit is contained in:
张泊明518370910136 2024-12-05 12:53:34 -05:00
parent 85e53f4f90
commit d0c6d27637
GPG Key ID: D47306D7062CDA9D

View File

@ -3,6 +3,7 @@ package healthcheck
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"log/slog"
"github.com/criyle/go-judge/envexec" "github.com/criyle/go-judge/envexec"
"github.com/joint-online-judge/JOJ3/internal/stage" "github.com/joint-online-judge/JOJ3/internal/stage"
@ -19,6 +20,7 @@ type Conf struct {
func Parse(executorResult stage.ExecutorResult, conf Conf) (stage.ParserResult, bool) { func Parse(executorResult stage.ExecutorResult, conf Conf) (stage.ParserResult, bool) {
stdout := executorResult.Files[conf.Stdout] stdout := executorResult.Files[conf.Stdout]
stderr := executorResult.Files[conf.Stderr] stderr := executorResult.Files[conf.Stderr]
slog.Debug("healthcheck files", "stdout", stdout, "stderr", stderr)
if executorResult.Status != stage.Status(envexec.StatusAccepted) { if executorResult.Status != stage.Status(envexec.StatusAccepted) {
return stage.ParserResult{ return stage.ParserResult{
Score: 0, Score: 0,
@ -39,6 +41,7 @@ func Parse(executorResult stage.ExecutorResult, conf Conf) (stage.ParserResult,
), ),
}, true }, true
} }
slog.Debug("healthcheck result", "res", res)
comment := res.Msg comment := res.Msg
forceQuit := res.Failed forceQuit := res.Failed
return stage.ParserResult{ return stage.ParserResult{