@atolis-hq/wake 0.3.60 → 0.3.61
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActivationClaimConflictError, RunStatus, WorkspaceMode } from '../../execution/index.js';
|
|
2
2
|
import { correlationId, EventActorKind, } from '../../kernel/index.js';
|
|
3
|
-
import { WorkflowStatus } from '../../orchestration/index.js';
|
|
3
|
+
import { isAmbiguityResolutionBlock, WorkflowStatus } from '../../orchestration/index.js';
|
|
4
4
|
import { WorkStatus } from '../../work/index.js';
|
|
5
5
|
import { ControlStreamKind } from '../contracts/streams.js';
|
|
6
6
|
import { DispatchPolicy } from '../domain/dispatch-policy.js';
|
|
@@ -84,7 +84,9 @@ export function createAdvanceOnce(orchestration, execution, resources, clock, de
|
|
|
84
84
|
(options.workItemId === undefined || workflow.workItemId === options.workItemId)
|
|
85
85
|
? [{ workflow, activation: workflow.pendingActivation }]
|
|
86
86
|
: []);
|
|
87
|
+
const ambiguityBlocked = blocked.filter((item) => isAmbiguityResolutionBlock(item.workflow.blockReason));
|
|
87
88
|
const recovery = (await findUnresolvedTerminal(pending, execution)) ??
|
|
89
|
+
(await findUnresolvedTerminal(ambiguityBlocked, execution)) ??
|
|
88
90
|
(await findUnresolvedSucceededTerminal(blocked, execution));
|
|
89
91
|
if (recovery !== undefined) {
|
|
90
92
|
if (await isDispatchPaused())
|
|
@@ -17,5 +17,5 @@ export async function findUnresolvedSucceededTerminal(pending, execution) {
|
|
|
17
17
|
return undefined;
|
|
18
18
|
}
|
|
19
19
|
export function isExecutionFailureTerminal(status) {
|
|
20
|
-
return
|
|
20
|
+
return status === RunStatus.Failed || status === RunStatus.Cancelled;
|
|
21
21
|
}
|
|
@@ -204,6 +204,6 @@ export class AdvanceWorkflow {
|
|
|
204
204
|
return matchWatches(await this.listAllLoaded(), event, this.workflows, context);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
function isAmbiguityResolutionBlock(reason) {
|
|
207
|
+
export function isAmbiguityResolutionBlock(reason) {
|
|
208
208
|
return reason !== undefined && /^run-ambiguous-after-\d+-attempts$/.test(reason);
|
|
209
209
|
}
|