mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
judge: remove unused processTestdata method
This commit is contained in:
3 files changed
-15
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user