judge: add secret config key

This commit is contained in:
undefined committed 2021-06-24 12:45:19 +08:00
1 parent 37ce0a4f66
commit e334c5e56b
11 files changed
+35 -12

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ import { ObjectID } from 'mongodb';
import { LangConfig } from '@hydrooj/utils/lib/lang';
import * as tmpfs from '../tmpfs';
import log from '../log';
import { compilerText, Queue } from '../utils';
import { compilerText, md5, Queue } from '../utils';
import { getConfig } from '../config';
import { FormatError, CompileError, SystemError } from '../error';
import { STATUS_COMPILE_ERROR, STATUS_SYSTEM_ERROR } from '../status';
@@ -111,7 +111,7 @@ class JudgeTask {
this.config = await readCases(
this.folder,
{ ...this.config, detail: this.session.config.detail },
{ next: this.next },
{ next: this.next, key: md5(`${this.domainId}${this.pid}${getConfig('secret')}`) },
);
this.stat.judge = new Date();
await judge[this.config.type || 'default'].judge(this);