mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
1 parent
c2cef76663
commit
4881165730
8 files changed
+191
-8
No files matched your search
@@ -6,6 +6,7 @@ import * as Judge from 'hydrooj/dist/handler/judge';
|
||||
import TaskModel from 'hydrooj/dist/model/task';
|
||||
import DomainModel from 'hydrooj/dist/model/domain';
|
||||
import ProblemModel from 'hydrooj/dist/model/problem';
|
||||
import { STATUS } from 'hydrooj/dist/model/builtin';
|
||||
import { sleep } from '@hydrooj/utils/lib/utils';
|
||||
import providers from './providers/index';
|
||||
import { BasicProvider, IBasicProvider, RemoteAccount } from './interface';
|
||||
@@ -26,9 +27,12 @@ class Service {
|
||||
}
|
||||
|
||||
async judge(task) {
|
||||
const rid = await this.api.submitProblem(task.target, task.lang, task.code, task);
|
||||
const next = (payload) => Judge.next({ ...payload, rid: task.rid });
|
||||
const end = (payload) => Judge.end({ ...payload, rid: task.rid });
|
||||
await next({ status: STATUS.STATUS_FETCHED });
|
||||
const rid = await this.api.submitProblem(task.target, task.lang, task.code, task, next, end);
|
||||
if (!rid) return;
|
||||
await next({ status: STATUS.STATUS_JUDGING });
|
||||
await this.api.waitForSubmission(rid, next, end);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user