You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was recently working on a project where I was pulling quite a bit of data from GitHub to generate statistics around thousands of pull requests generated.
In this case, I wanted intercept that response and cache it so that, when I inevitably had a bug in my code I could use the PyGitHub API to re-try pulling that exact same data again, but process it differently. I wanted to be able to do this without hitting the rate-limiter a second time.
Thus, I decided to use requests-cache to intercept the response and enable this.
However, since PyGitHub doesn't expose an API to change the session instance, I had to use the patch solution to patch the Session object. However, this is less than ideal in a multithreaded application.
The text was updated successfully, but these errors were encountered:
I guess getting access to the Session instance that is used by the Requester is sufficient, rather then providing an instance as a github.Github constructor argument.
Likely. One other thing I'm thinking about too is that the cache requester wouldn't need a delay before each request if the response is cached. But requests that don't hit the cache will still need a delay. I don't know if there's an easy way to make this work with this library and the current structure of PyGithub
I was recently working on a project where I was pulling quite a bit of data from GitHub to generate statistics around thousands of pull requests generated.
In this case, I wanted intercept that response and cache it so that, when I inevitably had a bug in my code I could use the PyGitHub API to re-try pulling that exact same data again, but process it differently. I wanted to be able to do this without hitting the rate-limiter a second time.
Thus, I decided to use
requests-cache
to intercept the response and enable this.https://requests-cache.readthedocs.io/en/stable/index.html
However, since PyGitHub doesn't expose an API to change the
session
instance, I had to use the patch solution to patch theSession
object. However, this is less than ideal in a multithreaded application.The text was updated successfully, but these errors were encountered: