build: compile dist/ [auto]

This commit is contained in:
github-actions[bot]
2026-03-14 00:06:32 +00:00
parent 086603e7ca
commit 98cde23e48
3 changed files with 21 additions and 2 deletions

19
dist/usage-api.js vendored
View File

@@ -127,6 +127,25 @@ function tryAcquireCacheLock(homeDir) {
}
}
const lockTimestamp = readLockTimestamp(lockPath);
// Unparseable timestamp — use mtime to distinguish a crash leftover from an active writer.
if (lockTimestamp === null) {
try {
const lockStat = fs.statSync(lockPath);
if (Date.now() - lockStat.mtimeMs < CACHE_LOCK_STALE_MS) {
return 'busy';
}
}
catch {
return tryAcquireCacheLock(homeDir);
}
try {
fs.unlinkSync(lockPath);
}
catch {
return 'busy';
}
return tryAcquireCacheLock(homeDir);
}
if (lockTimestamp != null && Date.now() - lockTimestamp > CACHE_LOCK_STALE_MS) {
try {
fs.unlinkSync(lockPath);