judge: 记录测试数据的最后使用时间

This commit is contained in:
undefined committed 2021-02-28 14:19:20 +08:00
1 parent 323e7011ba
commit c251cf33e8
4 files changed
+9 -3

No files matched your search

+1
View File
@@ -226,6 +226,7 @@ export default class Hydro {
fs.writeFileSync(path.join(filePath, 'etags'), JSON.stringify(version));
await this.processData(filePath).catch(noop);
}
fs.writeFileSync(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
return filePath;
}
+5 -1
View File
@@ -387,12 +387,16 @@ export default class VJ4 {
try {
ver = fs.readFileSync(path.join(filePath, 'version')).toString();
} catch (e) { /* ignore */ }
if (version === ver) return filePath;
if (version === ver) {
fs.writeFileSync(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
return filePath;
}
fs.removeSync(filePath);
}
fs.ensureDirSync(domainDir);
await this.problemData(domainId, pid, filePath, 3, next);
fs.writeFileSync(path.join(filePath, 'version'), version);
fs.writeFileSync(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
return filePath;
}
+1
View File
@@ -86,6 +86,7 @@ async function postInit() {
}
}
fs.writeFileSync(path.join(filePath, 'etags'), JSON.stringify(version));
fs.writeFileSync(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
await processData(filePath).catch(noop);
return filePath;
}