From 9cf7d70f41147f00990de8fcbe98e6dd3ac56d9b Mon Sep 17 00:00:00 2001 From: BlackPanda <2490665576@qq.com> Date: Fri, 1 Aug 2025 12:03:25 +0800 Subject: [PATCH] judge: update etags file on delete (#1021) --- packages/hydrojudge/src/task.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/hydrojudge/src/task.ts b/packages/hydrojudge/src/task.ts index 4828d4ace..1ac525d0f 100644 --- a/packages/hydrojudge/src/task.ts +++ b/packages/hydrojudge/src/task.ts @@ -131,9 +131,11 @@ export class JudgeTask { files.filter((i) => filenames.includes(i.name)) .map((i) => [i.name, join(filePath, i.name)]), )); - await fs.writeFile(join(filePath, 'etags'), JSON.stringify(version)); this.compileCache = {}; } + if (allFilesToRemove.length || filenames.length) { + await fs.writeFile(join(filePath, 'etags'), JSON.stringify(version)); + } await fs.writeFile(join(filePath, 'lastUsage'), Date.now().toString()); return filePath; } catch (e) {