judge: remove unused processTestdata method

This commit is contained in:
undefined committed 2023-03-11 00:22:08 +08:00
1 parent 5a0584f6b7
commit 656ef0d8f3
3 files changed
-15

No files matched your search

-11
View File
@@ -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;
-2
View File
@@ -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;
},
};
-2
View File
@@ -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;