Nextbird / nextbird

“Life support” fork of Corebird, a native GTK+ Twitter client
GNU General Public License v3.0
11 stars 1 forks source link

Investigate optimal heartbeat interval for avoiding Too Many Requests errors #2

Open lucaswerkmeister opened 5 years ago

lucaswerkmeister commented 5 years ago

To fix #1, I bumped the heartbeat interval from 45 seconds to 2 minutes, which is really just an arbitrary guess (though one that seems to work well in practice). Perhaps Twitter has some information on how frequently you’re allowed to make API calls? Otherwise we could experiment if e. g. 1½ minutes would also work.

lucaswerkmeister commented 5 years ago

According to this documentation, the rate limit is 15 requests per 15 minutes, so we could theoretically decrease the heartbeat interval to 60 seconds. However, the rate limit probably counts more requests than just the ones we do on each “heartbeat” (e. g. liking or favoriting a tweet, or loading its details, probably takes up a request?), so perhaps it’s better to stay on the safer side with 2 minutes.