mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: 记录测试数据的最后使用时间
This commit is contained in:
1 parent
323e7011ba
commit
c251cf33e8
4 files changed
+9
-3
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.3.15",
|
"version": "2.3.16",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"lint": "eslint . --ext ts --fix"
|
"lint": "eslint . --ext ts --fix"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,6 +226,7 @@ export default class Hydro {
|
|||||||
fs.writeFileSync(path.join(filePath, 'etags'), JSON.stringify(version));
|
fs.writeFileSync(path.join(filePath, 'etags'), JSON.stringify(version));
|
||||||
await this.processData(filePath).catch(noop);
|
await this.processData(filePath).catch(noop);
|
||||||
}
|
}
|
||||||
|
fs.writeFileSync(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -387,12 +387,16 @@ export default class VJ4 {
|
|||||||
try {
|
try {
|
||||||
ver = fs.readFileSync(path.join(filePath, 'version')).toString();
|
ver = fs.readFileSync(path.join(filePath, 'version')).toString();
|
||||||
} catch (e) { /* ignore */ }
|
} 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.removeSync(filePath);
|
||||||
}
|
}
|
||||||
fs.ensureDirSync(domainDir);
|
fs.ensureDirSync(domainDir);
|
||||||
await this.problemData(domainId, pid, filePath, 3, next);
|
await this.problemData(domainId, pid, filePath, 3, next);
|
||||||
fs.writeFileSync(path.join(filePath, 'version'), version);
|
fs.writeFileSync(path.join(filePath, 'version'), version);
|
||||||
|
fs.writeFileSync(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ async function postInit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fs.writeFileSync(path.join(filePath, 'etags'), JSON.stringify(version));
|
fs.writeFileSync(path.join(filePath, 'etags'), JSON.stringify(version));
|
||||||
|
fs.writeFileSync(path.join(filePath, 'lastUsage'), new Date().getTime().toString());
|
||||||
await processData(filePath).catch(noop);
|
await processData(filePath).catch(noop);
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user