serverless-alexa-skills
serverless-alexa-skills copied to clipboard
Call the Alexa API in serial to avoid throttling
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.