Description:
Currently, the fetch request in index.js does not use automatic retries, which can lead to inconsistent results if transient network errors occur. To improve reproducibility, the fetch call should be wrapped with p-retry. This will ensure the retrieval process is more robust and less likely to fail due to temporary issues.
Suggested changes:
- Install the
p-retry package as a dependency.
- Refactor the fetch logic in
sampleRetrieval to use pRetry for automatic retries.
- Make the number of retries and retry behaviour configurable if possible.
Example usage:
import pRetry from 'p-retry';
const res = await pRetry(() => fetch(url), { retries: 3 });
Description:
Currently, the fetch request in
index.jsdoes not use automatic retries, which can lead to inconsistent results if transient network errors occur. To improve reproducibility, the fetch call should be wrapped with p-retry. This will ensure the retrieval process is more robust and less likely to fail due to temporary issues.Suggested changes:
p-retrypackage as a dependency.sampleRetrievalto usepRetryfor automatic retries.Example usage: