serverless-alexa-skills icon indicating copy to clipboard operation
serverless-alexa-skills copied to clipboard

Call the Alexa API in serial to avoid throttling

Open lukelafountaine opened this issue 5 years ago • 0 comments

When you are supporting a larger number of skills, models, or locales, the number of Alexa API calls increases. The requests are often throttled because we are sending too many at once. If we send the requests in serial, we can avoid getting throttled.

Yes, it is slightly slower, but at least it doesn't fail.

I tried this change on a test skill that supports all 13 locales that Amazon supports. Without the delay, the API calls still occasionally fail. 200ms was the sweet spot where it doesn't fail, but it doesn't take too long either. It's a little bit of a guessing game as I can't find the actual request limit in the Alexa documentation.

This should resolve issue #26.

lukelafountaine avatar May 30 '19 19:05 lukelafountaine