mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
hydrojudge: add cgroup v2 check for judge (#642)
Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
1 parent
867cd069c5
commit
21ff3ce8f5
6 files changed
+35
-2
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user