judge: remove unused processTestdata method

pull/528/head
undefined 2 years ago
parent 5a0584f6b7
commit 656ef0d8f3
No known key found for this signature in database

@ -36,17 +36,6 @@ async function collectFiles(folder: string) {
return files;
}
export async function processTestdata(folder: string) {
let files = await fs.readdir(folder);
if (files.length <= 2) {
if (files.length === 2) files.splice(files.indexOf('version'), 1);
if (fs.statSync(path.resolve(folder, files[0])).isDirectory()) {
folder = path.resolve(folder, files[0]);
files = await fs.readdir(folder);
}
}
}
interface Args {
next: NextFunction;
key: string;

@ -7,7 +7,6 @@ import {
StorageModel, SystemModel, TaskModel,
} from 'hydrooj';
import { end, next } from 'hydrooj/src/handler/judge';
import { processTestdata } from '../cases';
import { getConfig } from '../config';
import { FormatError, SystemError } from '../error';
import { Context } from '../judge/interface';
@ -68,7 +67,6 @@ const session = {
fs.writeFile(path.join(filePath, 'etags'), JSON.stringify(version)),
fs.writeFile(path.join(filePath, 'lastUsage'), Date.now().toString()),
]);
await processTestdata(filePath);
return filePath;
},
};

@ -8,7 +8,6 @@ import { fs } from '@hydrooj/utils';
import { LangConfig } from '@hydrooj/utils/lib/lang';
import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
import type { JudgeResultBody } from 'hydrooj';
import { processTestdata } from '../cases';
import { getConfig } from '../config';
import { FormatError, SystemError } from '../error';
import log from '../log';
@ -117,7 +116,6 @@ export default class Hydro {
queue.start();
await Promise.all(tasks);
await fs.writeFile(path.join(filePath, 'etags'), JSON.stringify(version));
await processTestdata(filePath);
}
await fs.writeFile(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
return filePath;

Loading…
Cancel
Save