@@ -357,7 +357,10 @@ export class NunjucksWorkflowRunner implements WorkflowRunner {
|
||||
try {
|
||||
let prevValue: U | undefined;
|
||||
if (prevTaskState) {
|
||||
prevValue = prevTaskState.state[key] as unknown as U;
|
||||
const prevState = prevTaskState.state[key];
|
||||
if (prevState.status === 'success') {
|
||||
prevValue = prevState.value as U;
|
||||
}
|
||||
}
|
||||
|
||||
const value = prevValue ? prevValue : await fn();
|
||||
|
||||
@@ -26,6 +26,24 @@ export type TaskSecrets = Record<string, string> & {
|
||||
backstageToken?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* The record passed to {@link TaskBroker.updateCheckpoint?}
|
||||
* Parameters to store the result of the executed checkpoint
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type CheckpointRecord =
|
||||
| {
|
||||
key: string;
|
||||
status: 'success';
|
||||
value: JsonObject;
|
||||
}
|
||||
| {
|
||||
key: string;
|
||||
status: 'failed';
|
||||
reason: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* TaskState
|
||||
*
|
||||
@@ -115,24 +133,6 @@ export type TaskBrokerDispatchOptions = {
|
||||
createdBy?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* The record passed to {@link TaskBroker.updateCheckpoint?}
|
||||
* Parameters to store the result of the executed checkpoint
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type CheckpointRecord =
|
||||
| {
|
||||
key: string;
|
||||
status: 'success';
|
||||
value: JsonObject;
|
||||
}
|
||||
| {
|
||||
key: string;
|
||||
status: 'failed';
|
||||
reason: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Task
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user