jira-toggl icon indicating copy to clipboard operation
jira-toggl copied to clipboard

429 Too many requests

Open dogawaf opened this issue 3 years ago • 1 comments

Hello

If I select a date range of a week, with many time entries and several Toggl projects, Toggl rejects some api request with a "429 Too many request".

See a screenhost with some rejected requests: Capture d’écran de 2021-11-09 23-46-14 You can also see that more than one api request are made for the same project.

I see too optimizations here:

  • introduce a cache for projects: if one project has been fetched, no need to call the api again
  • if a request leads to a 429, wait for 500 milliseconds and retry it

dogawaf avatar Nov 09 '21 22:11 dogawaf

Hi @dogawaf

I think the easiest solution would be to use the axios-retry-after package which seems to do what you suggest. Will try to find some time to add it, but I've also added the help-wanted label if anyone else have time to add it :-)

simoneldevig avatar Nov 24 '21 12:11 simoneldevig