fix(remote_judger): request fetch_new option
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-02-03 18:17:59 +08:00
parent 42c473e1a0
commit 51e6711e7c
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 18 additions and 12 deletions

View File

@ -67,8 +67,8 @@ export default async function daemon(config: UOJConfig) {
if (config.test_sample_only === 'on') {
await request('/submit', {
submit: true,
fetch_new: false,
submit: 1,
fetch_new: 0,
id,
result: JSON.stringify({
status: 'Judged',
@ -80,6 +80,8 @@ export default async function daemon(config: UOJConfig) {
judge_time,
});
await sleep(TIME.second);
continue;
}
@ -115,8 +117,8 @@ export default async function daemon(config: UOJConfig) {
code = fs.readFileSync(sourceCodePath, 'utf-8');
} catch (e) {
await request('/submit', {
submit: true,
fetch_new: false,
submit: 1,
fetch_new: 0,
id,
result: JSON.stringify({
status: 'Judged',
@ -135,6 +137,8 @@ export default async function daemon(config: UOJConfig) {
fs.removeSync(tmpdir);
await sleep(TIME.second);
continue;
}
@ -152,8 +156,8 @@ export default async function daemon(config: UOJConfig) {
);
} catch (err) {
await request('/submit', {
submit: true,
fetch_new: false,
submit: 1,
fetch_new: 0,
id,
result: JSON.stringify({
status: 'Judged',
@ -172,6 +176,8 @@ export default async function daemon(config: UOJConfig) {
}
fs.removeSync(tmpdir);
await sleep(TIME.second);
}
} catch (err) {
logger.error(err.message);

View File

@ -98,8 +98,8 @@ class VJudge {
) {
const next = async payload => {
return await this.request('/submit', {
'update-status': true,
fetch_new: false,
'update-status': 1,
fetch_new: 0,
id,
status:
payload.status ||
@ -110,8 +110,8 @@ class VJudge {
const end = async payload => {
if (payload.error) {
return await this.request('/submit', {
submit: true,
fetch_new: false,
submit: 1,
fetch_new: 0,
id,
result: JSON.stringify({
status: 'Judged',
@ -128,8 +128,8 @@ class VJudge {
}
return await this.request('/submit', {
submit: true,
fetch_new: false,
submit: 1,
fetch_new: 0,
id,
result: JSON.stringify({
status: 'Judged',