mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
judge: bug fix
This commit is contained in:
1 parent
bba42d5936
commit
d29bd22249
3 files changed
+6
-8
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "3.1.9",
|
"version": "3.1.10",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export default class Hydro {
|
|||||||
send(rid: string | ObjectID, key: 'next' | 'end', data: Partial<JudgeResultBody>) {
|
send(rid: string | ObjectID, key: 'next' | 'end', data: Partial<JudgeResultBody>) {
|
||||||
data.rid = new ObjectID(rid);
|
data.rid = new ObjectID(rid);
|
||||||
data.key = key;
|
data.key = key;
|
||||||
if (data.case) data.case.message = removeNixPath(data.case.message || '');
|
if (data.case && typeof data.case.message === 'string') data.case.message = removeNixPath(data.case.message);
|
||||||
if (typeof data.message === 'string') data.message = removeNixPath(data.message);
|
if (typeof data.message === 'string') data.message = removeNixPath(data.message);
|
||||||
if (typeof data.compilerText === 'string') data.compilerText = removeNixPath(data.compilerText);
|
if (typeof data.compilerText === 'string') data.compilerText = removeNixPath(data.compilerText);
|
||||||
this.ws.send(JSON.stringify(data));
|
this.ws.send(JSON.stringify(data));
|
||||||
|
|||||||
@@ -992,12 +992,10 @@ export class ProblemCreateHandler extends Handler {
|
|||||||
export class ProblemPrefixListHandler extends Handler {
|
export class ProblemPrefixListHandler extends Handler {
|
||||||
@param('prefix', Types.Name)
|
@param('prefix', Types.Name)
|
||||||
async get(domainId: string, prefix: string) {
|
async get(domainId: string, prefix: string) {
|
||||||
const pdocs = await problem.getPrefixList(domainId, prefix);
|
const [pdocs, pdoc] = await Promise.all([
|
||||||
if (!Number.isNaN(+prefix) && !pdocs.filter((i) => i.docId === +prefix)) {
|
problem.getPrefixList(domainId, prefix),
|
||||||
const pdoc = await problem.get(domainId, +prefix, ['domainId', 'docId', 'pid', 'title']);
|
problem.get(domainId, Number.isSafeInteger(+prefix) ? +prefix : prefix, ['domainId', 'docId', 'pid', 'title']),
|
||||||
if (pdoc) pdocs.unshift(pdoc);
|
]);
|
||||||
}
|
|
||||||
const pdoc = await problem.get(domainId, prefix, ['domainId', 'docId', 'pid', 'title']);
|
|
||||||
if (pdoc) pdocs.unshift(pdoc);
|
if (pdoc) pdocs.unshift(pdoc);
|
||||||
if (pdocs.length < 20) {
|
if (pdocs.length < 20) {
|
||||||
const search = global.Hydro.lib.problemSearch || defaultSearch;
|
const search = global.Hydro.lib.problemSearch || defaultSearch;
|
||||||
|
|||||||
Reference in new issue
Block a user