requests-cache / aiohttp-client-cache

An async persistent cache for aiohttp requests
MIT License
118 stars 20 forks source link

Take disabled status of CachedSession for CacheActions #183

Closed netomi closed 1 year ago

netomi commented 1 year ago

This fixes #182 .

The proposed fix takes the disabled status of the CachedSession into account when the necessary CacheActions are determined from the request. I tried to follow the existing logic which already includes skip read / write. This could also be solved differently, but I would consider this to be a clean solution.

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (0b56f76) 96.87% compared to head (008428d) 97.20%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #183 +/- ## ========================================== + Coverage 96.87% 97.20% +0.33% ========================================== Files 10 10 Lines 927 931 +4 Branches 168 170 +2 ========================================== + Hits 898 905 +7 + Misses 18 15 -3 Partials 11 11 ``` | [Files](https://app.codecov.io/gh/requests-cache/aiohttp-client-cache/pull/183?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=requests-cache) | Coverage Δ | | |---|---|---| | [aiohttp\_client\_cache/backends/base.py](https://app.codecov.io/gh/requests-cache/aiohttp-client-cache/pull/183?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=requests-cache#diff-YWlvaHR0cF9jbGllbnRfY2FjaGUvYmFja2VuZHMvYmFzZS5weQ==) | `96.77% <ø> (ø)` | | | [aiohttp\_client\_cache/cache\_control.py](https://app.codecov.io/gh/requests-cache/aiohttp-client-cache/pull/183?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=requests-cache#diff-YWlvaHR0cF9jbGllbnRfY2FjaGUvY2FjaGVfY29udHJvbC5weQ==) | `98.27% <100.00%> (+0.03%)` | :arrow_up: | | [aiohttp\_client\_cache/session.py](https://app.codecov.io/gh/requests-cache/aiohttp-client-cache/pull/183?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=requests-cache#diff-YWlvaHR0cF9jbGllbnRfY2FjaGUvc2Vzc2lvbi5weQ==) | `97.87% <100.00%> (+6.76%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.