mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
19 lines
614 B
TypeScript
19 lines
614 B
TypeScript
import { LangConfig } from '@hydrooj/utils/lib/lang';
|
|
import { runQueued } from './sandbox';
|
|
|
|
export async function compilerVersions(langs: Record<string, LangConfig>) {
|
|
const result = {};
|
|
for (const lang in langs) {
|
|
const version = langs[lang].version;
|
|
if (!version) continue;
|
|
// eslint-disable-next-line no-await-in-loop
|
|
const res = await runQueued(version, {
|
|
copyIn: {},
|
|
time: 10000,
|
|
memory: 256 * 1024 * 1024,
|
|
}, 'compilerVersions', 5);
|
|
result[lang] = `${res.stdout}\n${res.stderr}`.trim();
|
|
}
|
|
return result;
|
|
}
|