Our client application uses repeated calls to the “GET friends/ids” API. When it hits Twitter’s rate limits and gets a 429 response (“too many requests”), it pauses until the time specified in the X-Rate-Limit-Reset response header.
On many computers this mechanism works fine–our application sleeps until the specified time, wakes up, and resumes calling “GET friends/ids.” On some computers, though, the first resumed call fails again with a 429 response. I don’t know why.
Do I need to add some “slop” time to the X-Rate-Limit-Reset value to compensate for client computer clocks that are not set exactly right? The value returned by Twitter is in seconds since 1/1/1970, so it seems that unless the client computer clock is set to the exact same time as Twitter’s server clocks, this timing mechanism is fragile. Or does Twitter already add some time to the header value to attempt to compensate for this?