mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&judge: support lang filter
This commit is contained in:
3 files changed
+6
-3
No files matched your search
@@ -294,8 +294,6 @@ class JudgeConnectionHandler extends ConnectionHandler {
|
||||
await updateJudge(msg.info);
|
||||
} else if (msg.key === 'prio' && typeof msg.prio === 'number') {
|
||||
this.query.priority = { $gt: msg.prio };
|
||||
} else if (msg.key === 'lang' && msg.lang instanceof Array && msg.lang.every((i) => typeof i === 'string')) {
|
||||
this.query.lang = { $in: msg.lang };
|
||||
} else if (msg.key === 'config') {
|
||||
if (Number.isSafeInteger(msg.prio)) {
|
||||
this.query.priority = { $gt: msg.prio };
|
||||
@@ -309,6 +307,9 @@ class JudgeConnectionHandler extends ConnectionHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (msg.lang instanceof Array && msg.lang.every((i) => typeof i === 'string')) {
|
||||
this.query.lang = { $in: msg.lang };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ export default class RecordModel {
|
||||
else if (meta?.type === 'generate') type = 'generate';
|
||||
return await task.addMany(rids.map((rid) => ({
|
||||
...(pdoc.config as any),
|
||||
lang: rdoc.lang,
|
||||
priority,
|
||||
type,
|
||||
rid,
|
||||
|
||||
Reference in new issue
Block a user