Skip to content

Use pRetry for fetch request in index.js to ensure reproducibility #13

@NikolasHaimerl

Description

@NikolasHaimerl

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 });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions