mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
judge: merge processTestdata
This commit is contained in:
1 parent
e4b916037c
commit
b74f6b64f8
15 files changed
+78
-152
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import cac from 'cac';
|
||||
import fs from 'fs-extra';
|
||||
import PQueue from 'p-queue';
|
||||
import { ParseEntry } from 'shell-quote';
|
||||
import { STATUS } from '@hydrooj/utils/lib/status';
|
||||
import { getConfig } from './config';
|
||||
@@ -191,3 +192,9 @@ export async function run(execute: string, params?: Parameter): Promise<SandboxA
|
||||
}
|
||||
return await adaptResult(result, params);
|
||||
}
|
||||
|
||||
const queue = new PQueue({ concurrency: getConfig('parallelism') });
|
||||
|
||||
export function runQueued(execute: string, params?: Parameter, priority = 0) {
|
||||
return queue.add(() => run(execute, params), { priority });
|
||||
}
|
||||
Reference in new issue
Block a user