-
Notifications
You must be signed in to change notification settings - Fork 26
Implemented a way how to watch the current api usage (rate limits) #25
Conversation
|
Hi @holm, can you please have a look at this and maybe provide me with an idea how to make it designed properly? |
|
Hello @albertfdp, I was thinking about it and finally I came to a decision that it would be the best if there was a base object called e. g. RateLimits which would all the classes that can be returned extend. |
|
The current approach seems fine for me: I am happy to merge it to master. What are you looking to achieve with what you are proposing now? |
|
I'm glad that you accept the current approach. I'd be glad if you merged this pull request. We can talk about the other approach later on. |
|
Does this account for response where the headers are not set? |
|
@daniel-sc |
|
@daniel-sc 👍 Yes, and some clients do not have rate limit, so the absence of such might be in all requests. Thanks @PetrF0X ! |
|
@albertfdp @daniel-sc Please have a look at the added code |
|
looks fine! |
|
@albertfdp Hello, can you please merge this? |
Implemented a way how to watch the current api usage (rate limits)
|
Done! |
It was a problem for me to watch the api usage (get the data from http headers). Finally I figured it out and here it is. I couldn't think of any concept how to save the data and I didn't need to store them. So I just look at the integers and print them out after every api call. If you have any idea how to make it better and more useful, please tell me.