Closed rudcode closed 7 months ago
Attention: Patch coverage is 88.88889%
with 5 lines
in your changes are missing coverage. Please review.
Project coverage is 97.31%. Comparing base (
5b54454
) to head (af930dc
). Report is 1 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
aiohttp_client_cache/session.py | 87.80% | 4 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Another thing to consider is lock cleanup. For a long-running cache with a large number of unique requests, the number of cache keys in memory could start to add up (roughly 1MB per 6K unique requests). I don't think that needs to be solved in this PR, though. I'll create a separate issue for that (#228).
Hi @JWCook, I use the lru_cache like you mention in #228, is it okay if I implement like this af930dc? Is 16k enough for the maxsize?
@JWCook @olk-m I use if/else for the python version but I think this makes the build check failed. What do you think?
I use the lru_cache like you mention in #228, is it okay if I implement like this https://github.com/requests-cache/aiohttp-client-cache/commit/af930dc482bfe00ed21c34d849090770a4ec02fa? Is 16k enough for the maxsize?
Yes, that looks good to me!
I use if/else for the python version but I think this makes the build check failed
That's fine, it looks like that's just because test coverage is only run for python 3.11 right now, so it thinks that else
branch (python <=3.9) isn't covered.
Merged. Thanks for the contribution @rudcode!
With this change if there is simultaneous request to the same url at the same time, it will only fetch the url once and the rest is feeded from cache
@olk-m @JWCook
I create a test like this, is it enough?