Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retryDelays not working #44

Closed
mahmood-kn opened this issue Oct 31, 2023 · 0 comments
Closed

retryDelays not working #44

mahmood-kn opened this issue Oct 31, 2023 · 0 comments

Comments

@mahmood-kn
Copy link

I'm trying to set retryDelays to send request every 10seconds until it reaches to 10 mins then throw error. but it doesn't send multiple requests and throw error after a while on first reqest.
This is my code:

 setUpload(file, {
      endpoint: `https://upload.domain.com`,
      retryDelays: [
        0, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000, 110000, 120000,
        130000, 140000, 150000, 160000, 170000, 180000, 190000, 200000, 210000, 220000, 230000,
        240000, 250000, 260000, 270000, 280000, 290000, 300000, 310000, 320000, 330000, 340000,
        350000, 360000, 370000, 380000, 390000, 400000, 410000, 420000, 430000, 440000, 450000,
        460000, 470000, 480000, 490000, 500000, 510000, 520000, 530000, 540000, 550000, 560000,
        570000, 580000, 590000, 600000,
      ],
      headers: {
        Authorization: `Bearer ${token}`,
      },
      metadata: {
        filename: file.name.split('.')[0],
        filetype: file.type.split('/')[1],
      },
      onProgress: function (bytesUploaded, bytesTotal) {
        const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2)

        setProgress(percentage)
      },
      onSuccess: function () {},
    })
@mahmood-kn mahmood-kn changed the title retryDelay not working retryDelays not working Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant