@rotorsoft/act 1.23.27 → 1.23.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/dist/index.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  TOMBSTONE_EVENT,
11
11
  cache,
12
12
  config,
13
+ dateReviver,
13
14
  dispose,
14
15
  disposeAndExit,
15
16
  extend,
@@ -20,7 +21,7 @@ import {
20
21
  sleep,
21
22
  store,
22
23
  validate
23
- } from "./chunk-UEZ7T2SX.js";
24
+ } from "./chunk-5B45U2IS.js";
24
25
  import {
25
26
  ActorSchema,
26
27
  CausationEventSchema,
@@ -2944,7 +2945,7 @@ var SettleLoop = class {
2944
2945
  this._running = true;
2945
2946
  (async () => {
2946
2947
  await this._deps.init();
2947
- let last_drain;
2948
+ let settled_drain;
2948
2949
  for (let i = 0; i < maxPasses; i++) {
2949
2950
  const after_before = this._deps.checkpoint();
2950
2951
  const { subscribed, last_id } = await this._deps.correlate({
@@ -2952,11 +2953,17 @@ var SettleLoop = class {
2952
2953
  after: after_before
2953
2954
  });
2954
2955
  if (this._deps.correlate_probes_store) this._deps.breaker.passed();
2955
- last_drain = await this._deps.drain(drain_options);
2956
- const made_progress = subscribed > 0 || last_drain.acked.length > 0 || last_drain.blocked.length > 0 || last_id > after_before;
2956
+ const drain = await this._deps.drain(drain_options);
2957
+ settled_drain = settled_drain ? {
2958
+ fetched: [...settled_drain.fetched, ...drain.fetched],
2959
+ leased: [...settled_drain.leased, ...drain.leased],
2960
+ acked: [...settled_drain.acked, ...drain.acked],
2961
+ blocked: [...settled_drain.blocked, ...drain.blocked]
2962
+ } : drain;
2963
+ const made_progress = subscribed > 0 || drain.acked.length > 0 || drain.blocked.length > 0 || last_id > after_before;
2957
2964
  if (!made_progress) break;
2958
2965
  }
2959
- if (last_drain) this._deps.on_settled(last_drain);
2966
+ if (settled_drain) this._deps.on_settled(settled_drain);
2960
2967
  })().catch((err) => {
2961
2968
  this._deps.breaker.failed(Date.now(), err);
2962
2969
  }).finally(() => {
@@ -5051,6 +5058,7 @@ export {
5051
5058
  act,
5052
5059
  cache,
5053
5060
  config,
5061
+ dateReviver,
5054
5062
  dispose,
5055
5063
  disposeAndExit,
5056
5064
  extend,