twhoffma / geeklistanalyser

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add support for HTTP 429 in qrequests.js #64

Open twhoffma opened 4 years ago

twhoffma commented 4 years ago

Appearantly, sometimes BGG API can return 429.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

Add support both for the status and for parsing the header to override the request delay if exponential backoff is less can the Retry-After header.

Also, the backoff should always be max of running try's delay and the max delay set by all running async processes. When a requests succeeds, it should be reset to 0.