mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
bug fixes
This commit is contained in:
10 files changed
+56
-65
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user