use of cn.edu.zjnu.acm.judge.data.dto.RunRecord in project judge by zjnu-acm.
the class JudgeService method toCompletableFuture.
CompletableFuture<?> toCompletableFuture(Executor executor, long submissionId) {
return CompletableFuture.runAsync(() -> {
Submission submission = submissionMapper.findOne(submissionId);
if (submission == null) {
throw new BusinessException(BusinessCode.SUBMISSION_NOT_FOUND);
}
Problem problem = problemService.findOneNoI18n(submission.getProblem());
RunRecord runRecord = RunRecord.builder().submissionId(submission.getId()).language(languageService.getAvailableLanguage(submission.getLanguage())).problemId(submission.getProblem()).userId(submission.getUser()).source(submissionMapper.findSourceById(submissionId)).memoryLimit(problem.getMemoryLimit()).timeLimit(problem.getTimeLimit()).build();
judgeInternal(runRecord);
}, executor);
}
Aggregations