hydrojudge: add cgroup v2 check for judge (#642)

Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
pandaandundefined authored and GitHub committed 2023-11-05 04:10:11 +08:00
1 parent 867cd069c5
commit 21ff3ce8f5
6 files changed
+35 -2

No files matched your search

+3 -1
View File
@@ -11,6 +11,7 @@ import { getConfig } from '../config';
import { FormatError, SystemError } from '../error';
import { Context } from '../judge/interface';
import logger from '../log';
import { versionCheck } from '../sandbox';
import { JudgeTask } from '../task';
const session = {
@@ -71,8 +72,9 @@ const session = {
},
};
export async function postInit() {
export async function postInit(ctx) {
if (SystemModel.get('hydrojudge.disable')) return;
ctx.check.addChecker('Judge', (_ctx, log, warn, error) => versionCheck(warn, error));
await fs.ensureDir(getConfig('tmp_dir'));
const handle = async (t) => {
const rdoc = await RecordModel.get(t.domainId, t.rid);