duosecurity / duo_api_nodejs

Other
20 stars 20 forks source link

Add backoff and retry when a request is rate limited #18

Closed zweglarz closed 5 years ago

zweglarz commented 5 years ago

If the request is rate limited, this library will now sleep for a bit and then try again. We use an exponential backoff, so the request should sleep for 1 second, then 2, then 4, 8, 16, and max out at 32 seconds.

Also add sinon as a dev dependency and bump the minor version number.