I'm seeing some strange behavior regarding Twitter rate limits. When I run the following code in my rails app (in an action in a controller), I often get the error:
Twitter::Error::TooManyRequests.
However, if I run the same code in the rails console, I have no problems and can make as many requests to Twitter as I want.
App code:
Twitter.mentions(count: 200, since_id: maximum(:tweet_id))
Rails console code:
Twitter.mentions(count: 200)
Why aren't the rate limits the same?
I'm using version 4.7.0 of the Twitter gem.
As an aside, I also notice that I get a different number of returned Tweets. I'm assuming that this is due to the same reason.