From 49eb0a8751caa8be64138aad24b8cea908e3852b Mon Sep 17 00:00:00 2001 From: Jaehyeon Kim <65964601+Jaehyeon1020@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:34:08 +0000 Subject: [PATCH] =?UTF-8?q?feat(be):=20serialize=20testcase=20judging=20-?= =?UTF-8?q?=20=EB=B3=91=EB=A0=AC=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=EB=90=98=EA=B3=A0=20=EC=9E=88=EB=8D=98=20tc=20?= =?UTF-8?q?=EC=B1=84=EC=A0=90=EC=9D=84=20=EC=A7=81=EB=A0=AC=ED=99=94?= =?UTF-8?q?=ED=95=A9=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/iris/src/handler/judge-handler.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/iris/src/handler/judge-handler.go b/apps/iris/src/handler/judge-handler.go index 83c5305676..547ca24afc 100644 --- a/apps/iris/src/handler/judge-handler.go +++ b/apps/iris/src/handler/judge-handler.go @@ -284,13 +284,9 @@ func (j *JudgeHandler) Handle(id string, data []byte, hidden bool, out chan Judg } tcNum := tc.Count() - cnt := make(chan int) for i := 0; i < tcNum; i++ { - go j.judgeTestcase(i, dir, validReq, tc.Elements[i], out, cnt) - } - - for i := 0; i < tcNum; i++ { - <-cnt + j.judgeTestcase(i, dir, validReq, tc.Elements[i], out) + // j.logger.Log(logger.DEBUG, fmt.Sprintf("Testcase %d judged", i)) } } @@ -324,7 +320,7 @@ func (j *JudgeHandler) getTestcase(traceCtx context.Context, out chan<- result.C } func (j *JudgeHandler) judgeTestcase(idx int, dir string, validReq *Request, - tc loader.Element, out chan JudgeResultMessage, cnt chan int) { + tc loader.Element, out chan JudgeResultMessage) { var accepted bool @@ -376,5 +372,4 @@ Send: // j.logger.Log(logger.DEBUG, string(marshaledRes)) out <- JudgeResultMessage{marshaledRes, ParseError(res)} } - cnt <- 1 }