Closed karpetrosyan closed 9 months ago
We can add a http_cache
option to the GitHub class and user may set it as None
or False
to disable, True
for default in-mem or some storage provider settings to control the caching behavior?
some storage provider settings to control the caching behavior?
We could inject httpx.Transport
or event httpx.Client
instances, but I believe that for now, this simple minimal change will suffice.
@karpetrosyan hello, i have encountered some errors when testing, it seems is caused by this pr.
The transport socket is not closed after httpx client closed. The GC throws the error when collect the transport.
Take a look at the code and find that the httpx.HTTPTransport()
is not closed.
wrapped transport only close the storage.
https://github.com/karpetrosyan/hishel/blob/0948f9e59e123f2703e199b844fcc394696b5921/hishel/_async/_transports.py#L235-L236 https://github.com/karpetrosyan/hishel/blob/0948f9e59e123f2703e199b844fcc394696b5921/hishel/_sync/_transports.py#L235-L236
I don't know if this is as designed for hishel?
githubkit
may needs to close the inner transport at the same time.
Hi! Yes, I see the issue. I'm going to release hishel today with this problem fixed.
Hishel v0.0.21 is out https://pypi.org/project/hishel/! Thanks for contribution
Closes #61
Adds RFC9111 HTTP caching, which caches responses that the server suggests reusing.
If we want to provide a way to disable caching, perhaps we should add something like
http_cache
boolean to theGitHub
class?