mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: allow minPriority config
This commit is contained in:
1 parent
936acf0139
commit
b548a48b23
10 files changed
+22
-12
No files matched your search
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user