()
| 581 | span.setAttribute("messaging.message.id", response.batchId); |
| 582 | |
| 583 | const getBatchResults = async (): Promise<BatchTaskRunExecutionResult> => { |
| 584 | // We need to check if the results are already available, but only if any of the items options has an idempotency key |
| 585 | const hasIdempotencyKey = items.some((item) => item.options?.idempotencyKey); |
| 586 | |
| 587 | if (hasIdempotencyKey) { |
| 588 | const results = await apiClient.getBatchResults(response.batchId); |
| 589 | |
| 590 | if (results) { |
| 591 | return results; |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | return { |
| 596 | id: response.batchId, |
| 597 | items: [], |
| 598 | }; |
| 599 | }; |
| 600 | |
| 601 | const existingResults = await getBatchResults(); |
| 602 |
no test coverage detected
searching dependent graphs…