@rivetkit/workflow-engine 0.0.0-2-3-0-rc-rollback.f0e199e → 0.0.0-ci-publish-node-24.62afe63
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/schemas/v1.ts +25 -0
- package/dist/tsup/{chunk-EAAPMGGE.js → chunk-DTS4S7RT.js} +185 -63
- package/dist/tsup/chunk-DTS4S7RT.js.map +1 -0
- package/dist/tsup/{chunk-A33YVYOF.cjs → chunk-KLHCG2KY.cjs} +185 -63
- package/dist/tsup/chunk-KLHCG2KY.cjs.map +1 -0
- package/dist/tsup/index.cjs +2 -2
- package/dist/tsup/index.cjs.map +1 -1
- package/dist/tsup/index.d.cts +45 -13
- package/dist/tsup/index.d.ts +45 -13
- package/dist/tsup/index.js +1 -1
- package/dist/tsup/testing.cjs +23 -23
- package/dist/tsup/testing.cjs.map +1 -1
- package/dist/tsup/testing.js +1 -1
- package/package.json +6 -1
- package/schemas/serde.ts +17 -3
- package/schemas/v1.bare +10 -1
- package/schemas/versioned.ts +1 -0
- package/src/context.ts +134 -30
- package/src/driver.ts +6 -0
- package/src/index.ts +41 -21
- package/src/location.ts +1 -1
- package/src/storage.ts +6 -2
- package/src/types.ts +20 -3
- package/dist/tsup/chunk-A33YVYOF.cjs.map +0 -1
- package/dist/tsup/chunk-EAAPMGGE.js.map +0 -1
package/dist/schemas/v1.ts
CHANGED
|
@@ -446,6 +446,23 @@ export function writeRemovedEntry(bc: bare.ByteCursor, x: RemovedEntry): void {
|
|
|
446
446
|
write1(bc, x.originalName)
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
+
export type VersionCheckEntry = {
|
|
450
|
+
readonly resolved: u32,
|
|
451
|
+
readonly latest: u32,
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export function readVersionCheckEntry(bc: bare.ByteCursor): VersionCheckEntry {
|
|
455
|
+
return {
|
|
456
|
+
resolved: bare.readU32(bc),
|
|
457
|
+
latest: bare.readU32(bc),
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export function writeVersionCheckEntry(bc: bare.ByteCursor, x: VersionCheckEntry): void {
|
|
462
|
+
bare.writeU32(bc, x.resolved)
|
|
463
|
+
bare.writeU32(bc, x.latest)
|
|
464
|
+
}
|
|
465
|
+
|
|
449
466
|
export type EntryKind =
|
|
450
467
|
| { readonly tag: "StepEntry", readonly val: StepEntry }
|
|
451
468
|
| { readonly tag: "LoopEntry", readonly val: LoopEntry }
|
|
@@ -455,6 +472,7 @@ export type EntryKind =
|
|
|
455
472
|
| { readonly tag: "JoinEntry", readonly val: JoinEntry }
|
|
456
473
|
| { readonly tag: "RaceEntry", readonly val: RaceEntry }
|
|
457
474
|
| { readonly tag: "RemovedEntry", readonly val: RemovedEntry }
|
|
475
|
+
| { readonly tag: "VersionCheckEntry", readonly val: VersionCheckEntry }
|
|
458
476
|
|
|
459
477
|
export function readEntryKind(bc: bare.ByteCursor): EntryKind {
|
|
460
478
|
const offset = bc.offset
|
|
@@ -476,6 +494,8 @@ export function readEntryKind(bc: bare.ByteCursor): EntryKind {
|
|
|
476
494
|
return { tag: "RaceEntry", val: readRaceEntry(bc) }
|
|
477
495
|
case 7:
|
|
478
496
|
return { tag: "RemovedEntry", val: readRemovedEntry(bc) }
|
|
497
|
+
case 8:
|
|
498
|
+
return { tag: "VersionCheckEntry", val: readVersionCheckEntry(bc) }
|
|
479
499
|
default: {
|
|
480
500
|
bc.offset = offset
|
|
481
501
|
throw new bare.BareError(offset, "invalid tag")
|
|
@@ -525,6 +545,11 @@ export function writeEntryKind(bc: bare.ByteCursor, x: EntryKind): void {
|
|
|
525
545
|
writeRemovedEntry(bc, x.val)
|
|
526
546
|
break
|
|
527
547
|
}
|
|
548
|
+
case "VersionCheckEntry": {
|
|
549
|
+
bare.writeU8(bc, 8)
|
|
550
|
+
writeVersionCheckEntry(bc, x.val)
|
|
551
|
+
break
|
|
552
|
+
}
|
|
528
553
|
}
|
|
529
554
|
}
|
|
530
555
|
|
|
@@ -670,6 +670,16 @@ function writeRemovedEntry(bc, x) {
|
|
|
670
670
|
bare.writeString(bc, x.originalType);
|
|
671
671
|
write1(bc, x.originalName);
|
|
672
672
|
}
|
|
673
|
+
function readVersionCheckEntry(bc) {
|
|
674
|
+
return {
|
|
675
|
+
resolved: bare.readU32(bc),
|
|
676
|
+
latest: bare.readU32(bc)
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
function writeVersionCheckEntry(bc, x) {
|
|
680
|
+
bare.writeU32(bc, x.resolved);
|
|
681
|
+
bare.writeU32(bc, x.latest);
|
|
682
|
+
}
|
|
673
683
|
function readEntryKind(bc) {
|
|
674
684
|
const offset = bc.offset;
|
|
675
685
|
const tag = bare.readU8(bc);
|
|
@@ -690,6 +700,8 @@ function readEntryKind(bc) {
|
|
|
690
700
|
return { tag: "RaceEntry", val: readRaceEntry(bc) };
|
|
691
701
|
case 7:
|
|
692
702
|
return { tag: "RemovedEntry", val: readRemovedEntry(bc) };
|
|
703
|
+
case 8:
|
|
704
|
+
return { tag: "VersionCheckEntry", val: readVersionCheckEntry(bc) };
|
|
693
705
|
default: {
|
|
694
706
|
bc.offset = offset;
|
|
695
707
|
throw new bare.BareError(offset, "invalid tag");
|
|
@@ -738,6 +750,11 @@ function writeEntryKind(bc, x) {
|
|
|
738
750
|
writeRemovedEntry(bc, x.val);
|
|
739
751
|
break;
|
|
740
752
|
}
|
|
753
|
+
case "VersionCheckEntry": {
|
|
754
|
+
bare.writeU8(bc, 8);
|
|
755
|
+
writeVersionCheckEntry(bc, x.val);
|
|
756
|
+
break;
|
|
757
|
+
}
|
|
741
758
|
}
|
|
742
759
|
}
|
|
743
760
|
function readEntry(bc) {
|
|
@@ -1182,6 +1199,14 @@ function entryKindToBare(kind) {
|
|
|
1182
1199
|
originalName: kind.data.originalName ?? null
|
|
1183
1200
|
}
|
|
1184
1201
|
};
|
|
1202
|
+
case "version_check":
|
|
1203
|
+
return {
|
|
1204
|
+
tag: "VersionCheckEntry",
|
|
1205
|
+
val: {
|
|
1206
|
+
resolved: kind.data.resolved,
|
|
1207
|
+
latest: kind.data.latest
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1185
1210
|
}
|
|
1186
1211
|
}
|
|
1187
1212
|
function entryKindFromBare(kind) {
|
|
@@ -1263,6 +1288,14 @@ function entryKindFromBare(kind) {
|
|
|
1263
1288
|
originalName: kind.val.originalName ?? void 0
|
|
1264
1289
|
}
|
|
1265
1290
|
};
|
|
1291
|
+
case "VersionCheckEntry":
|
|
1292
|
+
return {
|
|
1293
|
+
type: "version_check",
|
|
1294
|
+
data: {
|
|
1295
|
+
resolved: kind.val.resolved,
|
|
1296
|
+
latest: kind.val.latest
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1266
1299
|
default:
|
|
1267
1300
|
throw new Error(
|
|
1268
1301
|
`Unknown entry kind: ${kind.tag}`
|
|
@@ -1574,8 +1607,12 @@ async function flush(storage, driver, onHistoryUpdated, pendingDeletions) {
|
|
|
1574
1607
|
});
|
|
1575
1608
|
}
|
|
1576
1609
|
if (writes.length > 0) {
|
|
1577
|
-
|
|
1578
|
-
await driver.batch(
|
|
1610
|
+
if (driver.atomicBatch) {
|
|
1611
|
+
await driver.batch(writes);
|
|
1612
|
+
} else {
|
|
1613
|
+
for (const chunk of splitBatchWrites(writes)) {
|
|
1614
|
+
await driver.batch(chunk);
|
|
1615
|
+
}
|
|
1579
1616
|
}
|
|
1580
1617
|
}
|
|
1581
1618
|
if (pendingDeletions) {
|
|
@@ -1664,30 +1701,6 @@ function setEntry(storage, location, entry) {
|
|
|
1664
1701
|
storage.history.entries.set(key, entry);
|
|
1665
1702
|
}
|
|
1666
1703
|
|
|
1667
|
-
// src/utils.ts
|
|
1668
|
-
function sleep(ms) {
|
|
1669
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1670
|
-
}
|
|
1671
|
-
var TIMEOUT_MAX = 2147483647;
|
|
1672
|
-
function setLongTimeout(listener, after) {
|
|
1673
|
-
let timeout;
|
|
1674
|
-
function start(remaining) {
|
|
1675
|
-
if (remaining <= TIMEOUT_MAX) {
|
|
1676
|
-
timeout = setTimeout(listener, remaining);
|
|
1677
|
-
} else {
|
|
1678
|
-
timeout = setTimeout(() => {
|
|
1679
|
-
start(remaining - TIMEOUT_MAX);
|
|
1680
|
-
}, TIMEOUT_MAX);
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1683
|
-
start(after);
|
|
1684
|
-
return {
|
|
1685
|
-
abort: () => {
|
|
1686
|
-
if (timeout !== void 0) clearTimeout(timeout);
|
|
1687
|
-
}
|
|
1688
|
-
};
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
1704
|
// src/context.ts
|
|
1692
1705
|
var DEFAULT_MAX_RETRIES = 3;
|
|
1693
1706
|
var DEFAULT_RETRY_BACKOFF_BASE = 100;
|
|
@@ -1963,7 +1976,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
1963
1976
|
* Throws HistoryDivergedError if duplicate detected.
|
|
1964
1977
|
*/
|
|
1965
1978
|
checkDuplicateName(name) {
|
|
1966
|
-
const fullKey = locationToKey(this.storage, this.currentLocation)
|
|
1979
|
+
const fullKey = `${locationToKey(this.storage, this.currentLocation)}/${name}`;
|
|
1967
1980
|
if (this.usedNamesInExecution.has(fullKey)) {
|
|
1968
1981
|
throw new HistoryDivergedError(
|
|
1969
1982
|
`Duplicate entry name "${name}" at location "${locationToKey(this.storage, this.currentLocation)}". Each step/loop/sleep/queue.next/join/race must have a unique name within its scope.`
|
|
@@ -2017,7 +2030,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2017
2030
|
validateComplete() {
|
|
2018
2031
|
const prefix = locationToKey(this.storage, this.currentLocation);
|
|
2019
2032
|
for (const key of this.storage.history.entries.keys()) {
|
|
2020
|
-
const isUnderPrefix = prefix === "" ? true : key.startsWith(prefix
|
|
2033
|
+
const isUnderPrefix = prefix === "" ? true : key.startsWith(`${prefix}/`) || key === prefix;
|
|
2021
2034
|
if (isUnderPrefix) {
|
|
2022
2035
|
if (!this.visitedKeys.has(key)) {
|
|
2023
2036
|
throw new HistoryDivergedError(
|
|
@@ -2034,25 +2047,33 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2034
2047
|
this.abortController.abort(new EvictedError());
|
|
2035
2048
|
}
|
|
2036
2049
|
/**
|
|
2037
|
-
* Wait for
|
|
2038
|
-
*
|
|
2039
|
-
*
|
|
2040
|
-
*
|
|
2050
|
+
* Wait for `ms`, rejecting early with EvictedError if the workflow is
|
|
2051
|
+
* evicted. Both the timer and the abort listener are torn down on either
|
|
2052
|
+
* outcome, so a completed sleep never leaves a dangling listener on the
|
|
2053
|
+
* long-lived run abort signal.
|
|
2041
2054
|
*/
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2055
|
+
async sleepOrEvict(ms) {
|
|
2056
|
+
if (this.abortSignal.aborted) {
|
|
2057
|
+
throw new EvictedError();
|
|
2058
|
+
}
|
|
2059
|
+
let timer;
|
|
2060
|
+
let onAbort;
|
|
2061
|
+
try {
|
|
2062
|
+
await new Promise((resolve, reject) => {
|
|
2063
|
+
timer = setTimeout(resolve, ms);
|
|
2064
|
+
onAbort = () => reject(new EvictedError());
|
|
2065
|
+
this.abortSignal.addEventListener("abort", onAbort, {
|
|
2066
|
+
once: true
|
|
2067
|
+
});
|
|
2068
|
+
});
|
|
2069
|
+
} finally {
|
|
2070
|
+
if (timer !== void 0) {
|
|
2071
|
+
clearTimeout(timer);
|
|
2047
2072
|
}
|
|
2048
|
-
|
|
2049
|
-
"abort",
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
},
|
|
2053
|
-
{ once: true }
|
|
2054
|
-
);
|
|
2055
|
-
});
|
|
2073
|
+
if (onAbort) {
|
|
2074
|
+
this.abortSignal.removeEventListener("abort", onAbort);
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2056
2077
|
}
|
|
2057
2078
|
// === Step ===
|
|
2058
2079
|
async step(nameOrConfig, run) {
|
|
@@ -2294,7 +2315,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2294
2315
|
entry.kind.data.error = String(error);
|
|
2295
2316
|
}
|
|
2296
2317
|
entry.dirty = true;
|
|
2297
|
-
if (error instanceof StepTimeoutError) {
|
|
2318
|
+
if (error instanceof StepTimeoutError && !config2.retryOnTimeout) {
|
|
2298
2319
|
metadata.status = "exhausted";
|
|
2299
2320
|
metadata.error = String(error);
|
|
2300
2321
|
await this.notifyStepError(config2, metadata.attempts, error, {
|
|
@@ -2350,7 +2371,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2350
2371
|
attachTryStepFailure(
|
|
2351
2372
|
new StepExhaustedError(config2.name, String(error)),
|
|
2352
2373
|
{
|
|
2353
|
-
kind: "exhausted",
|
|
2374
|
+
kind: error instanceof StepTimeoutError ? "timeout" : "exhausted",
|
|
2354
2375
|
stepName: config2.name,
|
|
2355
2376
|
attempts: metadata.attempts,
|
|
2356
2377
|
error: extractErrorInfo(error)
|
|
@@ -2368,7 +2389,9 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2368
2389
|
*
|
|
2369
2390
|
* Note: This does NOT cancel the underlying operation. JavaScript Promises
|
|
2370
2391
|
* cannot be cancelled once started. When a timeout occurs:
|
|
2371
|
-
* - The step is
|
|
2392
|
+
* - The step is rejected with StepTimeoutError. By default this is treated
|
|
2393
|
+
* as a critical failure with no retry. Set retryOnTimeout: true on the
|
|
2394
|
+
* step config to retry timeouts like any other error.
|
|
2372
2395
|
* - The underlying async operation continues running in the background
|
|
2373
2396
|
* - Any side effects from the operation may still occur
|
|
2374
2397
|
*
|
|
@@ -2693,7 +2716,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2693
2716
|
return;
|
|
2694
2717
|
}
|
|
2695
2718
|
if (remaining < this.driver.workerPollInterval) {
|
|
2696
|
-
await
|
|
2719
|
+
await this.sleepOrEvict(remaining);
|
|
2697
2720
|
this.checkEvicted();
|
|
2698
2721
|
if (entry.kind.type === "sleep") {
|
|
2699
2722
|
entry.kind.data.state = "completed";
|
|
@@ -3502,8 +3525,91 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
3502
3525
|
setEntry(this.storage, location, entry);
|
|
3503
3526
|
await this.flushStorage();
|
|
3504
3527
|
}
|
|
3528
|
+
// === Version ===
|
|
3529
|
+
async getVersion(name, latest) {
|
|
3530
|
+
this.assertNotInProgress();
|
|
3531
|
+
this.checkEvicted();
|
|
3532
|
+
this.entryInProgress = true;
|
|
3533
|
+
try {
|
|
3534
|
+
return await this.executeGetVersion(name, latest);
|
|
3535
|
+
} finally {
|
|
3536
|
+
this.entryInProgress = false;
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3539
|
+
async executeGetVersion(name, latest) {
|
|
3540
|
+
if (!Number.isInteger(latest) || latest < 1) {
|
|
3541
|
+
throw new Error(
|
|
3542
|
+
`getVersion("${name}", ${latest}): latest must be an integer >= 1`
|
|
3543
|
+
);
|
|
3544
|
+
}
|
|
3545
|
+
this.checkDuplicateName(name);
|
|
3546
|
+
const location = appendName(this.storage, this.currentLocation, name);
|
|
3547
|
+
const key = locationToKey(this.storage, location);
|
|
3548
|
+
const existing = this.storage.history.entries.get(key);
|
|
3549
|
+
this.markVisited(key);
|
|
3550
|
+
this.stopRollbackIfMissing(existing);
|
|
3551
|
+
if (existing) {
|
|
3552
|
+
if (existing.kind.type !== "version_check") {
|
|
3553
|
+
throw new HistoryDivergedError(
|
|
3554
|
+
`Expected version_check at ${key}, found ${existing.kind.type}`
|
|
3555
|
+
);
|
|
3556
|
+
}
|
|
3557
|
+
return existing.kind.data.resolved;
|
|
3558
|
+
}
|
|
3559
|
+
const resolved = this.hasUnvisitedUnderCurrentScope(key) ? 1 : latest;
|
|
3560
|
+
const entry = createEntry(location, {
|
|
3561
|
+
type: "version_check",
|
|
3562
|
+
data: { resolved, latest }
|
|
3563
|
+
});
|
|
3564
|
+
setEntry(this.storage, location, entry);
|
|
3565
|
+
await this.flushStorage();
|
|
3566
|
+
return resolved;
|
|
3567
|
+
}
|
|
3568
|
+
/**
|
|
3569
|
+
* Returns true if any history entry under the current location scope
|
|
3570
|
+
* (other than `excludeKey`) has not yet been visited this run. Used by
|
|
3571
|
+
* getVersion to detect an old in-flight instance whose scope was already
|
|
3572
|
+
* executed by code that predates a version gate.
|
|
3573
|
+
*/
|
|
3574
|
+
hasUnvisitedUnderCurrentScope(excludeKey) {
|
|
3575
|
+
const prefix = locationToKey(this.storage, this.currentLocation);
|
|
3576
|
+
for (const key of this.storage.history.entries.keys()) {
|
|
3577
|
+
if (key === excludeKey) {
|
|
3578
|
+
continue;
|
|
3579
|
+
}
|
|
3580
|
+
const isUnderPrefix = prefix === "" ? true : key.startsWith(`${prefix}/`) || key === prefix;
|
|
3581
|
+
if (isUnderPrefix && !this.visitedKeys.has(key)) {
|
|
3582
|
+
return true;
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3585
|
+
return false;
|
|
3586
|
+
}
|
|
3505
3587
|
};
|
|
3506
3588
|
|
|
3589
|
+
// src/utils.ts
|
|
3590
|
+
function sleep(ms) {
|
|
3591
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3592
|
+
}
|
|
3593
|
+
var TIMEOUT_MAX = 2147483647;
|
|
3594
|
+
function setLongTimeout(listener, after) {
|
|
3595
|
+
let timeout;
|
|
3596
|
+
function start(remaining) {
|
|
3597
|
+
if (remaining <= TIMEOUT_MAX) {
|
|
3598
|
+
timeout = setTimeout(listener, remaining);
|
|
3599
|
+
} else {
|
|
3600
|
+
timeout = setTimeout(() => {
|
|
3601
|
+
start(remaining - TIMEOUT_MAX);
|
|
3602
|
+
}, TIMEOUT_MAX);
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
start(after);
|
|
3606
|
+
return {
|
|
3607
|
+
abort: () => {
|
|
3608
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
3609
|
+
}
|
|
3610
|
+
};
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3507
3613
|
// src/index.ts
|
|
3508
3614
|
var Loop = {
|
|
3509
3615
|
continue: (state) => ({
|
|
@@ -3727,25 +3833,41 @@ async function executeLiveWorkflow(workflowId, workflowFn, input, driver, messag
|
|
|
3727
3833
|
const hasMessages = result.waitingForMessages !== void 0;
|
|
3728
3834
|
const hasDeadline = result.sleepUntil !== void 0;
|
|
3729
3835
|
if (hasMessages && hasDeadline) {
|
|
3836
|
+
const iterationAbort = new AbortController();
|
|
3837
|
+
const onRunAbort = () => iterationAbort.abort();
|
|
3838
|
+
if (abortController.signal.aborted) {
|
|
3839
|
+
iterationAbort.abort();
|
|
3840
|
+
} else {
|
|
3841
|
+
abortController.signal.addEventListener("abort", onRunAbort, {
|
|
3842
|
+
once: true
|
|
3843
|
+
});
|
|
3844
|
+
}
|
|
3845
|
+
const messagePromise = awaitWithEviction(
|
|
3846
|
+
driver.waitForMessages(
|
|
3847
|
+
result.waitingForMessages,
|
|
3848
|
+
iterationAbort.signal
|
|
3849
|
+
),
|
|
3850
|
+
iterationAbort.signal
|
|
3851
|
+
);
|
|
3852
|
+
const sleepPromise = waitForSleep(
|
|
3853
|
+
runtime,
|
|
3854
|
+
result.sleepUntil,
|
|
3855
|
+
iterationAbort.signal
|
|
3856
|
+
);
|
|
3857
|
+
messagePromise.catch(() => {
|
|
3858
|
+
});
|
|
3859
|
+
sleepPromise.catch(() => {
|
|
3860
|
+
});
|
|
3730
3861
|
try {
|
|
3731
|
-
const messagePromise = awaitWithEviction(
|
|
3732
|
-
driver.waitForMessages(
|
|
3733
|
-
result.waitingForMessages,
|
|
3734
|
-
abortController.signal
|
|
3735
|
-
),
|
|
3736
|
-
abortController.signal
|
|
3737
|
-
);
|
|
3738
|
-
const sleepPromise = waitForSleep(
|
|
3739
|
-
runtime,
|
|
3740
|
-
result.sleepUntil,
|
|
3741
|
-
abortController.signal
|
|
3742
|
-
);
|
|
3743
3862
|
await Promise.race([messagePromise, sleepPromise]);
|
|
3744
3863
|
} catch (error) {
|
|
3745
3864
|
if (error instanceof EvictedError) {
|
|
3746
3865
|
return lastResult;
|
|
3747
3866
|
}
|
|
3748
3867
|
throw error;
|
|
3868
|
+
} finally {
|
|
3869
|
+
iterationAbort.abort();
|
|
3870
|
+
abortController.signal.removeEventListener("abort", onRunAbort);
|
|
3749
3871
|
}
|
|
3750
3872
|
continue;
|
|
3751
3873
|
}
|
|
@@ -4188,15 +4310,15 @@ export {
|
|
|
4188
4310
|
deleteEntriesWithPrefix,
|
|
4189
4311
|
getEntry,
|
|
4190
4312
|
setEntry,
|
|
4191
|
-
sleep,
|
|
4192
4313
|
DEFAULT_MAX_RETRIES,
|
|
4193
4314
|
DEFAULT_RETRY_BACKOFF_BASE,
|
|
4194
4315
|
DEFAULT_RETRY_BACKOFF_MAX,
|
|
4195
4316
|
DEFAULT_LOOP_HISTORY_PRUNE_INTERVAL,
|
|
4196
4317
|
DEFAULT_STEP_TIMEOUT,
|
|
4197
4318
|
WorkflowContextImpl,
|
|
4319
|
+
sleep,
|
|
4198
4320
|
Loop,
|
|
4199
4321
|
runWorkflow,
|
|
4200
4322
|
replayWorkflowFromStep
|
|
4201
4323
|
};
|
|
4202
|
-
//# sourceMappingURL=chunk-
|
|
4324
|
+
//# sourceMappingURL=chunk-DTS4S7RT.js.map
|