mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
more resilient tests
This commit is contained in:
parent
a17c841d77
commit
9c6c918890
@ -40,7 +40,16 @@ export const withGeneratorLock = async <T>(fn: () => Promise<T>) => {
|
||||
try {
|
||||
return await fn();
|
||||
} finally {
|
||||
fs.unlinkSync(lockFilePath);
|
||||
try {
|
||||
fs.unlinkSync(lockFilePath);
|
||||
} catch (e) {
|
||||
if ("code" in e && e.code === "ENOENT") {
|
||||
// Someone else already deleted the lock file, not sure why but let's keep going
|
||||
console.warn(`Generator lock file ${lockFilePath} already deleted by someone else, not sure why but let's keep going. You may want to investigate this.`);
|
||||
return;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user