(
runId: string,
lookups: readonly WorkflowStepLookup[]
)
| 671 | } |
| 672 | |
| 673 | async getSteps( |
| 674 | runId: string, |
| 675 | lookups: readonly WorkflowStepLookup[] |
| 676 | ): Promise<Array<WorkflowStepRecord | null>> { |
| 677 | if (lookups.length === 0) { |
| 678 | return []; |
| 679 | } |
| 680 | const requestedKeys = new Set(lookups.map(getWorkflowStepKey)); |
| 681 | const byKey = new Map<string, WorkflowStepRecord>(); |
| 682 | for (const step of await this.readSteps(runId)) { |
| 683 | const key = getWorkflowStepKey(step); |
| 684 | if (requestedKeys.has(key)) { |
| 685 | byKey.set(key, step); |
| 686 | } |
| 687 | } |
| 688 | return lookups.map((lookup) => byKey.get(getWorkflowStepKey(lookup)) ?? null); |
| 689 | } |
| 690 | |
| 691 | async acquireLease(runId: string, ownerId: string, nowMs = Date.now()): Promise<boolean> { |
| 692 | assert(ownerId.length > 0, "WorkflowRunStore.acquireLease: ownerId is required"); |
no test coverage detected