mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: bug fixes
This commit is contained in:
4 files changed
+7
-7
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.22",
|
"version": "3.1.23",
|
||||||
"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",
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ interface Args {
|
|||||||
key: string;
|
key: string;
|
||||||
isSelfSubmission: boolean;
|
isSelfSubmission: boolean;
|
||||||
lang: string;
|
lang: string;
|
||||||
langConfig: LangConfig;
|
langConfig?: LangConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function readCases(folder: string, cfg: ProblemConfigFile = {}, args: Args): Promise<ParsedConfig> {
|
export default async function readCases(folder: string, cfg: ProblemConfigFile = {}, args: Args): Promise<ParsedConfig> {
|
||||||
@@ -68,8 +68,8 @@ export default async function readCases(folder: string, cfg: ProblemConfigFile =
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw changeErrorType(e, FormatError);
|
throw changeErrorType(e, FormatError);
|
||||||
}
|
}
|
||||||
const timeRate = +(config.time_limit_rate?.[args.lang] || args.langConfig.time_limit_rate) || 1;
|
const timeRate = +(config.time_limit_rate?.[args.lang] || args.langConfig?.time_limit_rate || 1) || 1;
|
||||||
const memoryRate = +(config.memory_limit_rate?.[args.lang] || args.langConfig.memory_limit_rate) || 1;
|
const memoryRate = +(config.memory_limit_rate?.[args.lang] || args.langConfig?.memory_limit_rate || 1) || 1;
|
||||||
const checkFile = ensureFile(folder);
|
const checkFile = ensureFile(folder);
|
||||||
const result = await readYamlCases(config, checkFile)
|
const result = await readYamlCases(config, checkFile)
|
||||||
.catch((e) => { throw changeErrorType(e, FormatError); });
|
.catch((e) => { throw changeErrorType(e, FormatError); });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "4.9.5",
|
"version": "4.9.6",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/plugin-api",
|
"main": "src/plugin-api",
|
||||||
"module": "src/plugin-api",
|
"module": "src/plugin-api",
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export default class RecordModel {
|
|||||||
let data: FileInfo[] = [];
|
let data: FileInfo[] = [];
|
||||||
let source = `${domainId}/${rdoc.pid}`;
|
let source = `${domainId}/${rdoc.pid}`;
|
||||||
meta = { ...meta, problemOwner: 1 };
|
meta = { ...meta, problemOwner: 1 };
|
||||||
|
await task.deleteMany({ rid: { $in: rids } });
|
||||||
if (rdoc.pid) {
|
if (rdoc.pid) {
|
||||||
let pdoc = await problem.get(rdoc.domainId, rdoc.pid);
|
let pdoc = await problem.get(rdoc.domainId, rdoc.pid);
|
||||||
if (!pdoc) throw new ProblemNotFoundError(rdoc.domainId, rdoc.pid);
|
if (!pdoc) throw new ProblemNotFoundError(rdoc.domainId, rdoc.pid);
|
||||||
@@ -81,8 +82,8 @@ export default class RecordModel {
|
|||||||
source = `${pdoc.domainId}/${pdoc.docId}`;
|
source = `${pdoc.domainId}/${pdoc.docId}`;
|
||||||
data = pdoc.data;
|
data = pdoc.data;
|
||||||
if (typeof pdoc.config === 'string') throw new Error(pdoc.config);
|
if (typeof pdoc.config === 'string') throw new Error(pdoc.config);
|
||||||
|
config.type = pdoc.config.type as any;
|
||||||
if (pdoc.config.type === 'remote_judge' && rdoc.contest?.toHexString() !== '0'.repeat(24)) {
|
if (pdoc.config.type === 'remote_judge' && rdoc.contest?.toHexString() !== '0'.repeat(24)) {
|
||||||
await task.deleteMany({ rid: { $in: rids } });
|
|
||||||
return await task.addMany(rids.map((rid) => ({
|
return await task.addMany(rids.map((rid) => ({
|
||||||
...(pdoc.config as any),
|
...(pdoc.config as any),
|
||||||
priority,
|
priority,
|
||||||
@@ -94,7 +95,6 @@ export default class RecordModel {
|
|||||||
} as any)));
|
} as any)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await task.deleteMany({ rid: { $in: rids } });
|
|
||||||
return await task.addMany(rids.map((rid) => ({
|
return await task.addMany(rids.map((rid) => ({
|
||||||
priority,
|
priority,
|
||||||
type: 'judge',
|
type: 'judge',
|
||||||
|
|||||||
Reference in new issue
Block a user