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
View File
@@ -20,6 +20,7 @@ import { fs } from '@hydrooj/utils';
import { getConfig } from './config';
import HydroHost from './hosts/hydro';
import log from './log';
import { versionCheck } from './sandbox';
const hosts: Record<string, HydroHost> = {};
let exit = false;
@@ -44,6 +45,8 @@ process.on('unhandledRejection', (reason, p) => {
});
async function daemon() {
const shouldRun = await versionCheck((msg) => log.error(msg));
if (!shouldRun) process.exit(1);
const _hosts = getConfig('hosts');
const queue = new PQueue({ concurrency: Infinity });
await fs.ensureDir(getConfig('tmp_dir'));