mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09: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
@@ -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'));
|
||||
|
||||
Reference in new issue
Block a user