diff --git a/apps/iris/src/common/constants/constants.go b/apps/iris/src/common/constants/constants.go index 0aae1ce8cc..dccb337ead 100644 --- a/apps/iris/src/common/constants/constants.go +++ b/apps/iris/src/common/constants/constants.go @@ -53,3 +53,5 @@ const ( EXCHANGE = "judger-exchange" RESULT_KEY = "result" ) + +const MAX_OUTPUT = 1048576 // 1MB diff --git a/apps/iris/src/handler/judge-handler.go b/apps/iris/src/handler/judge-handler.go index 100774f58f..c5c2e9ffd1 100644 --- a/apps/iris/src/handler/judge-handler.go +++ b/apps/iris/src/handler/judge-handler.go @@ -351,9 +351,8 @@ func (j *JudgeHandler) judgeTestcase(idx int, dir string, validReq *Request, res.SetJudgeExecResult(runResult.ExecResult) res.Output = string(runResult.Output) - // Output이 1000자를 넘어가는 경우 1000자까지만 사용 - if len(res.Output) > 1000 { - res.Output = res.Output[:1000] + if len(res.Output) > constants.MAX_OUTPUT { + res.Output = res.Output[:constants.MAX_OUTPUT] } if runResult.ExecResult.ResultCode != sandbox.RUN_SUCCESS {