Question

I am using a relatively recent Ruby library within my Rails (3.2) app which integrates the "After The Deadline" API. The library has two methods that I am passing within the "create" action of a controller which call on the AtD API:

AfterTheDeadline.stats(@table.textcolumn)
AfterTheDeadline.check(@table.textcolumn)

It ends up being the case that when you pass these two calls in rapid succession, the AtD API has some sort of rate limit (which I didn't know about), yielding the following error:

Unexpected response code from AtD service: 503 Service Temporarily Unavailable

Anyway, I'm asking this question in order to answer immediately in case anyone has the same problem in the future...

Was it helpful?

Solution

With the kind help of the Gem author, the solution to the problem (some sort of rate limit set inconspicuously by the AtD service) is to add sleep(1) before the check call.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top