@rotorsoft/act 1.32.28 → 1.32.29
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 +10 -8
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/internal/circuit-breaker.d.ts +6 -5
- package/dist/@types/internal/circuit-breaker.d.ts.map +1 -1
- package/dist/@types/internal/drain-cycle.d.ts +2 -2
- package/dist/index.cjs +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1153,12 +1153,13 @@ var CircuitBreaker = class {
|
|
|
1153
1153
|
* if a half-open trial just failed. Returns the resulting state.
|
|
1154
1154
|
*
|
|
1155
1155
|
* Callers gate on the state directly — `state(now) === "open"` means skip.
|
|
1156
|
-
*
|
|
1157
|
-
*
|
|
1156
|
+
* Every failure (re)schedules the `on_retry` wake, so one failed pass on
|
|
1157
|
+
* an idle app retries without waiting for the breaker to open; always
|
|
1158
|
+
* surfaces the failure via `on_error`.
|
|
1158
1159
|
*/
|
|
1159
1160
|
failed(now, error) {
|
|
1160
1161
|
const circuit = this._advance(now);
|
|
1161
|
-
|
|
1162
|
+
this._schedule_wake();
|
|
1162
1163
|
this._hooks.on_error?.(error, circuit);
|
|
1163
1164
|
return circuit;
|
|
1164
1165
|
}
|
|
@@ -2845,13 +2846,13 @@ var DrainController = class {
|
|
|
2845
2846
|
* Local wake at the earliest parked (backoff or defer) visit, or at the
|
|
2846
2847
|
* lease expiry after a failed pass (the {@link RETRY} key); the schedule
|
|
2847
2848
|
* itself is persisted. On an idle app nothing else would drain it. It
|
|
2848
|
-
* drains until a pass leases nothing, and an entry
|
|
2849
|
-
* until a later pass claims nothing.
|
|
2849
|
+
* drains until a pass leases nothing or the controller stops, and an entry
|
|
2850
|
+
* stays until handled or until a later pass claims nothing.
|
|
2850
2851
|
*/
|
|
2851
2852
|
_defer = new DeferTimer(() => {
|
|
2852
2853
|
this._armed = true;
|
|
2853
2854
|
void this._deps.run_scoped(async () => {
|
|
2854
|
-
while ((await this.drain()).leased.length > 0) ;
|
|
2855
|
+
while (!this._stopped && (await this.drain()).leased.length > 0) ;
|
|
2855
2856
|
});
|
|
2856
2857
|
});
|
|
2857
2858
|
_worker;
|