@rotorsoft/act 1.31.21 → 1.31.23
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/README.md +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts +8 -0
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/index.cjs +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3840,11 +3840,19 @@ var Act = class {
|
|
|
3840
3840
|
* It is waited on like any cycle, and deriving from the lanes alone gave
|
|
3841
3841
|
* it a budget of `0` whenever it was the only thing running — which
|
|
3842
3842
|
* returned before the wait it was about to be added to.
|
|
3843
|
+
*
|
|
3844
|
+
* A lane configured `leaseMillis: 0` takes the fallback rather than its
|
|
3845
|
+
* own value, which is why this coalesces on falsy and not just on absent
|
|
3846
|
+
* (#1647). A zero-length lease expires the instant it is granted, so it
|
|
3847
|
+
* has no answer to offer for "how long may a handler hold this stream" —
|
|
3848
|
+
* it is the pinned-no-lease case spelled with a number, and #1617 already
|
|
3849
|
+
* settled what that case is worth. Taking it literally derived a budget
|
|
3850
|
+
* of `0` and abandoned the very cycle this had just found running.
|
|
3843
3851
|
*/
|
|
3844
3852
|
_derive_grace_ms(running, settling) {
|
|
3845
3853
|
let max = settling ? DEFAULT_SHUTDOWN_GRACE_MS : 0;
|
|
3846
3854
|
for (const c of running)
|
|
3847
|
-
max = Math.max(max, c.lease_millis
|
|
3855
|
+
max = Math.max(max, c.lease_millis || DEFAULT_SHUTDOWN_GRACE_MS);
|
|
3848
3856
|
return Math.min(max, MAX_SHUTDOWN_GRACE_MS);
|
|
3849
3857
|
}
|
|
3850
3858
|
async _await_inflight(grace_ms) {
|