@rotorsoft/act 2.1.3 → 2.1.4
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/.tsbuildinfo +1 -1
- package/dist/@types/internal/autoclose-reaction.d.ts.map +1 -1
- package/dist/@types/internal/event-sourcing.d.ts.map +1 -1
- package/dist/@types/types/action.d.ts +2 -2
- package/dist/@types/types/builders.d.ts +2 -2
- package/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1286,6 +1286,7 @@ async function scan(source, opts = {}, callback) {
|
|
|
1286
1286
|
let id;
|
|
1287
1287
|
await source.query(
|
|
1288
1288
|
async (event) => {
|
|
1289
|
+
if (at !== void 0 && event.id <= at) return;
|
|
1289
1290
|
got++;
|
|
1290
1291
|
id = event.id;
|
|
1291
1292
|
processed++;
|
|
@@ -2341,10 +2342,12 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
|
|
|
2341
2342
|
throw new CloseSignal({
|
|
2342
2343
|
stream: aggregate,
|
|
2343
2344
|
archive: archiver ? () => archiver(aggregate, head) : void 0,
|
|
2344
|
-
//
|
|
2345
|
-
//
|
|
2346
|
-
//
|
|
2347
|
-
|
|
2345
|
+
// Hold the head and look again tomorrow: a close skipped for a
|
|
2346
|
+
// lagging reaction, or a failed archive, retries then, and a
|
|
2347
|
+
// closed stream has no head left to act on. The close guard
|
|
2348
|
+
// ignores this parked row, so it doesn't block its own close.
|
|
2349
|
+
at: head.id - 1,
|
|
2350
|
+
defer: days_after(/* @__PURE__ */ new Date(), 1)
|
|
2348
2351
|
});
|
|
2349
2352
|
if (keep_days !== void 0) {
|
|
2350
2353
|
const cutoff = days_before_now(keep_days);
|