core&judge: support lang filter

This commit is contained in:
undefined committed 2023-12-15 09:49:40 +08:00
1 parent d121a7148a
commit 928bd9f467
3 files changed
+6 -3

No files matched your search

+3 -2
View File
@@ -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 };
}
}
}