()
| 682 | const runningBlockIds = new Set<string>() |
| 683 | |
| 684 | const schedulePartialWrite = () => { |
| 685 | if (terminalWritten) return |
| 686 | const dataSnapshot: RowData = { ...accumulatedData } |
| 687 | const blockErrorsSnapshot = { ...blockErrors } |
| 688 | const runningSnapshot = Array.from(runningBlockIds) |
| 689 | writeChain = writeChain |
| 690 | .then(async () => { |
| 691 | if (signal?.aborted) return |
| 692 | if (terminalWritten) return |
| 693 | await writeState( |
| 694 | { |
| 695 | status: 'running', |
| 696 | executionId, |
| 697 | jobId: null, |
| 698 | workflowId, |
| 699 | error: null, |
| 700 | runningBlockIds: runningSnapshot, |
| 701 | blockErrors: blockErrorsSnapshot, |
| 702 | }, |
| 703 | dataSnapshot |
| 704 | ) |
| 705 | }) |
| 706 | .catch((err) => { |
| 707 | logger.warn( |
| 708 | `Per-block partial write failed (table=${tableId} row=${rowId} group=${groupId})`, |
| 709 | { cause: describeError(err), retryable: isRetryableInfrastructureError(err) } |
| 710 | ) |
| 711 | }) |
| 712 | } |
| 713 | |
| 714 | const onBlockStart = async (blockId: string): Promise<void> => { |
| 715 | if (!outputsByBlockId.has(blockId)) return |
no test coverage detected