botmux-workflow-core 3.18.3 → 3.18.5
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/cjs/runtime.cjs
CHANGED
|
@@ -1992,6 +1992,21 @@ function resumeStaleBreakSync(lockPath, claimPath, observed, claimWasCreated, mi
|
|
|
1992
1992
|
}
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
|
+
var FileLockTimeoutError = class extends Error {
|
|
1996
|
+
constructor(lockPath, holderPid, lockAgeMs) {
|
|
1997
|
+
super(
|
|
1998
|
+
`file-lock timeout waiting for ${lockPath} (held by pid ${holderPid || "?"}, age ${Math.round(lockAgeMs)}ms)`
|
|
1999
|
+
);
|
|
2000
|
+
this.lockPath = lockPath;
|
|
2001
|
+
this.holderPid = holderPid;
|
|
2002
|
+
this.lockAgeMs = lockAgeMs;
|
|
2003
|
+
this.name = "FileLockTimeoutError";
|
|
2004
|
+
}
|
|
2005
|
+
lockPath;
|
|
2006
|
+
holderPid;
|
|
2007
|
+
lockAgeMs;
|
|
2008
|
+
code = "FILE_LOCK_TIMEOUT";
|
|
2009
|
+
};
|
|
1995
2010
|
function withFileLockSync(targetPath, fn, opts = {}) {
|
|
1996
2011
|
const maxWaitMs = opts.maxWaitMs ?? MAX_WAIT_MS;
|
|
1997
2012
|
const minStaleAgeMs = opts.minStaleAgeMs ?? MIN_STALE_AGE_MS;
|
|
@@ -2079,9 +2094,7 @@ function withFileLockSync(targetPath, fn, opts = {}) {
|
|
|
2079
2094
|
}
|
|
2080
2095
|
}
|
|
2081
2096
|
if (Date.now() - start > maxWaitMs) {
|
|
2082
|
-
throw new
|
|
2083
|
-
`file-lock timeout waiting for ${lockPath} (held by pid ${holder?.pid || "?"}, age ${Math.round(lockAgeMs)}ms)`
|
|
2084
|
-
);
|
|
2097
|
+
throw new FileLockTimeoutError(lockPath, holder?.pid, lockAgeMs);
|
|
2085
2098
|
}
|
|
2086
2099
|
sleepSync(RETRY_BASE_MS + Math.random() * RETRY_BASE_MS);
|
|
2087
2100
|
}
|