feat(saves): localize battle and preset names, merge overview form and guard cache writes
This commit is contained in:
1 parent
e6e75d92c6
commit
7cb1011f0d
11 files changed
+276
-59
No files matched your search
@@ -162,5 +162,12 @@ function readEntry(path: string): CacheEntry | undefined {
|
||||
}
|
||||
|
||||
function writeEntry(path: string, entry: CacheEntry): void {
|
||||
writeFileAtomic(path, JSON.stringify(entry));
|
||||
try {
|
||||
writeFileAtomic(path, JSON.stringify(entry));
|
||||
} catch (error) {
|
||||
const code = (error as NodeJS.ErrnoException).code;
|
||||
// Another worker updating the same cache file on Windows can hold a brief lock; reading stays valid.
|
||||
if (code === 'EPERM' || code === 'EBUSY' || code === 'EACCES') return;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user