judge: allow minPriority config

This commit is contained in:
undefined committed 2021-04-22 13:01:36 +08:00
1 parent 936acf0139
commit b548a48b23
10 files changed
+22 -12

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.5.10",
"version": "2.5.11",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+1 -1
View File
@@ -244,7 +244,7 @@ export default class Hydro {
this.ws.send(this.config.cookie);
global.onDestory.push(() => this.ws.close());
setInterval(() => {
this.ws.send('{"event":"ping"}');
this.ws.send(`{"key":"prio","prio":${this.config.minPriority || -50}}`);
}, 30000);
});
this.ws.on('message', (data) => {
@@ -1,5 +1,6 @@
import Queue from 'p-queue';
import fs from 'fs-extra';
import { argv } from 'yargs';
import * as STATUS from '../status';
import { parse } from '../testlib';
import { findFileSync, parseFilename } from '../utils';
+1
View File
@@ -243,6 +243,7 @@ async function postInit() {
}
task.consume({ type: 'judge' }, (t) => (new JudgeTask(t)).handle().catch(logger.error));
task.consume({ type: 'judge', priority: { $gt: -50 } }, (t) => (new JudgeTask(t)).handle().catch(logger.error));
}
global.Hydro.service.bus.once('app/started', postInit);