nicoespeon / trello-kanban-analysis-tool

💤 [Not maintained] Analyse Kanban metrics from a Trello board -
http://nicoespeon.com/trello-kanban-analysis-tool/
MIT License
114 stars 33 forks source link

Prevent Trello from returning HTTP 429 (Rate limit exceeded) #17

Open nicoespeon opened 8 years ago

nicoespeon commented 8 years ago

Trello API has a rate limit of 300 requests per 10 seconds for each API key and no more than 100 requests per 10 second interval for each token: http://help.trello.com/article/838-api-rate-limits

When calculating Lead Time, TKAT lists cards which information is missing over the selected period to retrieve them. Doing so, it might exceed the rate limit. Same thing could happen if user switch between boards quickly.

Trello Driver should handle this case since it seems to break the observable.

Solutions I got in mind:


What we need is a way to buffer requests to consume them within delay limitations from Trello API. This just sounds like pausableBuffered: http://rxmarbles.com/#pausableBuffered

We should find a way to pause the input stream, buffering requests when we reach the limit within the defined interval… Then resume the stream as long as limitation is respected (technically, requests could pass every second while the 10 last seconds don't produce more than 100 requests).

To dig it deeper: http://reactivex.io/documentation/operators/backpressure.html


The thing is: Trello requests input is an observable which items are arrays containing cards IDs, each of which will produce a request.

---A----B-------C-----D---->

A = [ "574545f1a9b62eb12d06d61f", "5702ea4ae9363783899936f2", "56ef9c5b204ac6983bb49bb2" ]

There has to be some kind of transformation through observable to use the technique mentioned. Or to find a workaround.

CamelKing commented 7 years ago

Any update on this or this is now an accepted limitation of Trello?

I am trying to setup a board with a lots of cards, half way through entering the cards, I keep getting this information, and some of which I keyed in (card's details, labeling, etc) all gone when I refreshed it.

As I proceed this happens every other second with missing data, sadly I have to say at this stage Trello becomes unusable. :(

nicoespeon commented 7 years ago

Hi @CamelKing,

This is a limitation from Trello, but this tool should find a workaround to that. Thus, the issue is still open, with a potential lead to a solution described.

However, I don't use this tool these days and I've got a lot of other things to do, so I didn't get back to this one. I can't tell you when this will be solved, but I fear this won't be anytime soon if I bet on my agenda 😅

CamelKing commented 7 years ago

@nicoespeon that's cool :)