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

+4 -1
View File
@@ -118,6 +118,7 @@ export class JudgeFilesDownloadHandler extends Handler {
class JudgeConnectionHandler extends ConnectionHandler {
processing: any = null;
closed = false;
query: any = { type: 'judge' };
async prepare() {
logger.info('Judge daemon connected from ', this.request.ip);
@@ -132,7 +133,7 @@ class JudgeConnectionHandler extends ConnectionHandler {
await sleep(100);
if (this.closed) return;
// eslint-disable-next-line no-await-in-loop
t = await task.getFirst({ type: 'judge' });
t = await task.getFirst(this.query);
}
this.send({ task: t });
this.processing = t;
@@ -150,6 +151,8 @@ class JudgeConnectionHandler extends ConnectionHandler {
await this.newTask();
} else if (msg.key === 'status') {
await updateJudge(msg.info);
} else if (msg.key === 'prio') {
this.query.priority = { $gt: msg.prio };
}
}
+1 -1
View File
@@ -211,7 +211,7 @@ export class ProblemDetailHandler extends ProblemHandler {
// TODO maybe async?
await record.getMulti(domainId, { pid }).forEach(async (doc) => {
await record.reset(domainId, doc._id, true);
await record.judge(domainId, doc._id, -1);
await record.judge(domainId, doc._id, -50);
});
this.back();
}