mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +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;
|
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 {
|
interface Args {
|
||||||
next: NextFunction;
|
next: NextFunction;
|
||||||
key: string;
|
key: string;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
StorageModel, SystemModel, TaskModel,
|
StorageModel, SystemModel, TaskModel,
|
||||||
} from 'hydrooj';
|
} from 'hydrooj';
|
||||||
import { end, next } from 'hydrooj/src/handler/judge';
|
import { end, next } from 'hydrooj/src/handler/judge';
|
||||||
import { processTestdata } from '../cases';
|
|
||||||
import { getConfig } from '../config';
|
import { getConfig } from '../config';
|
||||||
import { FormatError, SystemError } from '../error';
|
import { FormatError, SystemError } from '../error';
|
||||||
import { Context } from '../judge/interface';
|
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, 'etags'), JSON.stringify(version)),
|
||||||
fs.writeFile(path.join(filePath, 'lastUsage'), Date.now().toString()),
|
fs.writeFile(path.join(filePath, 'lastUsage'), Date.now().toString()),
|
||||||
]);
|
]);
|
||||||
await processTestdata(filePath);
|
|
||||||
return filePath;
|
return filePath;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { fs } from '@hydrooj/utils';
|
|||||||
import { LangConfig } from '@hydrooj/utils/lib/lang';
|
import { LangConfig } from '@hydrooj/utils/lib/lang';
|
||||||
import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
|
import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
|
||||||
import type { JudgeResultBody } from 'hydrooj';
|
import type { JudgeResultBody } from 'hydrooj';
|
||||||
import { processTestdata } from '../cases';
|
|
||||||
import { getConfig } from '../config';
|
import { getConfig } from '../config';
|
||||||
import { FormatError, SystemError } from '../error';
|
import { FormatError, SystemError } from '../error';
|
||||||
import log from '../log';
|
import log from '../log';
|
||||||
@@ -117,7 +116,6 @@ export default class Hydro {
|
|||||||
queue.start();
|
queue.start();
|
||||||
await Promise.all(tasks);
|
await Promise.all(tasks);
|
||||||
await fs.writeFile(path.join(filePath, 'etags'), JSON.stringify(version));
|
await fs.writeFile(path.join(filePath, 'etags'), JSON.stringify(version));
|
||||||
await processTestdata(filePath);
|
|
||||||
}
|
}
|
||||||
await fs.writeFile(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
|
await fs.writeFile(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
|
||||||
return filePath;
|
return filePath;
|
||||||
|
|||||||
Reference in new issue
Block a user