Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/local-ai-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,6 @@ export async function withLocalLock<T>(home: string, name: string, work: () => P
let stale = !owner && Date.now() - stat.mtimeMs >= 30_000;
if (owner) stale = localProcessIsGone(owner, instance);
if (stale) {
if (stat.isFile()) {
// Legacy file locks predate atomic directory publication.
// unlink cannot remove a fresh directory lock if another
// contender has already recovered and acquired this path.
try { fs.unlinkSync(lock); continue; }
catch (reclaim) {
if (reclaim?.code === "ENOENT") continue;
if (fs.lstatSync(lock, { throwIfNoEntry: false })?.isDirectory()) continue;
throw reclaim;
}
}
const fingerprint = createHash("sha256").update(`${stat.dev}:${stat.ino}:${stat.birthtimeMs}`).digest("hex").slice(0, 24);
const tombstone = `${lock}.stale-${fingerprint}`;
try {
Expand Down
Loading