core: 修复错误

* 无法下载测试数据的问题
* 无法导出作业成绩单的问题
* cli 模式无法载入的问题
* syzoj 导入跳转错误的问题
This commit is contained in:
undefined committed 2021-01-25 22:23:06 +08:00
1 parent 66639b14de
commit f0b9bee937
8 files changed
+19 -26

No files matched your search

+2 -1
View File
@@ -71,6 +71,7 @@ async function postInit() {
}
async function cacheOpen(domainId: string, pid: string, files: any[]) {
console.log(files);
const filePath = path.join(getConfig('cache_dir'), domainId, pid);
await fs.ensureDir(filePath);
if (!files.length) throw new SystemError('Problem data not found.');
@@ -82,7 +83,7 @@ async function postInit() {
for (const file of files) {
version[file.name] = file.etag;
if (etags[file.name] !== file.etag) {
await storage.get(`${file.prefix}${file.name}`, path.join(filePath, file.name));
await storage.get(`problem/${domainId}/${pid}/testdata/${file.name}`, path.join(filePath, file.name));
}
}
fs.writeFileSync(path.join(filePath, 'etags'), JSON.stringify(version));