botmux-workflow-core 3.18.4 → 3.18.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/runtime.cjs +16 -3
- package/dist/cjs/runtime.cjs.map +2 -2
- package/dist/esm/runtime.js +16 -3
- package/dist/esm/runtime.js.map +2 -2
- package/package.json +1 -1
package/dist/esm/runtime.js
CHANGED
|
@@ -1987,6 +1987,21 @@ function resumeStaleBreakSync(lockPath, claimPath, observed, claimWasCreated, mi
|
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
1989
|
}
|
|
1990
|
+
var FileLockTimeoutError = class extends Error {
|
|
1991
|
+
constructor(lockPath, holderPid, lockAgeMs) {
|
|
1992
|
+
super(
|
|
1993
|
+
`file-lock timeout waiting for ${lockPath} (held by pid ${holderPid || "?"}, age ${Math.round(lockAgeMs)}ms)`
|
|
1994
|
+
);
|
|
1995
|
+
this.lockPath = lockPath;
|
|
1996
|
+
this.holderPid = holderPid;
|
|
1997
|
+
this.lockAgeMs = lockAgeMs;
|
|
1998
|
+
this.name = "FileLockTimeoutError";
|
|
1999
|
+
}
|
|
2000
|
+
lockPath;
|
|
2001
|
+
holderPid;
|
|
2002
|
+
lockAgeMs;
|
|
2003
|
+
code = "FILE_LOCK_TIMEOUT";
|
|
2004
|
+
};
|
|
1990
2005
|
function withFileLockSync(targetPath, fn, opts = {}) {
|
|
1991
2006
|
const maxWaitMs = opts.maxWaitMs ?? MAX_WAIT_MS;
|
|
1992
2007
|
const minStaleAgeMs = opts.minStaleAgeMs ?? MIN_STALE_AGE_MS;
|
|
@@ -2074,9 +2089,7 @@ function withFileLockSync(targetPath, fn, opts = {}) {
|
|
|
2074
2089
|
}
|
|
2075
2090
|
}
|
|
2076
2091
|
if (Date.now() - start > maxWaitMs) {
|
|
2077
|
-
throw new
|
|
2078
|
-
`file-lock timeout waiting for ${lockPath} (held by pid ${holder?.pid || "?"}, age ${Math.round(lockAgeMs)}ms)`
|
|
2079
|
-
);
|
|
2092
|
+
throw new FileLockTimeoutError(lockPath, holder?.pid, lockAgeMs);
|
|
2080
2093
|
}
|
|
2081
2094
|
sleepSync(RETRY_BASE_MS + Math.random() * RETRY_BASE_MS);
|
|
2082
2095
|
}
|