(heights: number[], numAttempts = MAX_RECONNECT_ATTEMPTS)
| 52 | private connectionRetrys: Record<string, Promise<void> | undefined> = {}; |
| 53 | |
| 54 | async fetchBlocks(heights: number[], numAttempts = MAX_RECONNECT_ATTEMPTS): Promise<B> { |
| 55 | return this.retryFetch(async () => { |
| 56 | // Get the latest fetch function from the provider |
| 57 | const apiInstance = this.connectionPoolService.api; |
| 58 | return apiInstance.fetchBlocks(heights); |
| 59 | }, numAttempts); |
| 60 | } |
| 61 | |
| 62 | protected async retryFetch(fn: () => Promise<B>, numAttempts = MAX_RECONNECT_ATTEMPTS): Promise<B> { |
| 63 | try { |
nothing calls this directly
no test coverage detected