bug fixes

This commit is contained in:
undefined committed 2025-10-23 17:57:29 +08:00
1 parent d0944bdde9
commit 2f2e006eff
10 files changed
+56 -65

No files matched your search

+6 -8
View File
@@ -69,21 +69,19 @@ export async function apply(ctx: HydroContext) {
const parallelism = getConfig('parallelism');
async function collectInfo() {
const coll = db.collection('status');
const compilers = await compilerVersions(langs);
const [compilers, size] = await Promise.all([
compilerVersions(langs),
stackSize(),
]);
await coll.updateOne(
{ mid: info.mid, type: 'server' },
{ $set: { compilers } },
{ upsert: true },
);
const size = await stackSize();
await coll.updateOne(
{ mid: info.mid, type: 'server' },
{ $set: { stackSize: size } },
{ $set: { compilers, stackSize: size } },
{ upsert: true },
);
}
ctx.effect(() => {
const taskConsumer = TaskModel.consume({ type: 'judge' }, handle, true, parallelism);
collectInfo();
const dispose = ctx.on('system/setting', () => {
taskConsumer.setConcurrency(getConfig('parallelism'));
collectInfo();