Address Greptile review: trim version, remove redundant fs/promises import, use fixed .tmp suffix

This commit is contained in:
2026-04-12 14:22:00 -04:00
parent ddf36667f9
commit aed1a886a9
3 changed files with 18 additions and 4 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ function writeStore(records: AdapterPluginRecord[]): void {
// Atomic write: write to a temp file in the same directory then rename.
// rename() is atomic on POSIX when source and target are on the same
// filesystem, preventing partial/corrupted reads from concurrent processes.
const tmpPath = `${ADAPTER_PLUGINS_STORE_PATH}.${process.pid}.tmp`;
const tmpPath = `${ADAPTER_PLUGINS_STORE_PATH}.tmp`;
fs.writeFileSync(tmpPath, JSON.stringify(records, null, 2), "utf-8");
fs.renameSync(tmpPath, ADAPTER_PLUGINS_STORE_PATH);
storeCache = records;