fix: recover from malformed instance lock files
Co-authored-by: Haze <hazeone@users.noreply.github.com>
This commit is contained in:
@@ -76,7 +76,9 @@ export function acquireProcessInstanceFileLock(
|
||||
}
|
||||
|
||||
ownerPid = readLockOwnerPid(lockPath);
|
||||
if (ownerPid && !isPidAlive(ownerPid) && existsSync(lockPath)) {
|
||||
const shouldTreatAsStale =
|
||||
ownerPid === undefined || !isPidAlive(ownerPid);
|
||||
if (shouldTreatAsStale && existsSync(lockPath)) {
|
||||
try {
|
||||
rmSync(lockPath, { force: true });
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user