cnaas-nms icon indicating copy to clipboard operation
cnaas-nms copied to clipboard

Select caching decorator based on run state

Open lunkwill42 opened this issue 3 years ago • 1 comments

This introduces a new lru_cache decorator that will change its behavior according to the current environment.

If imported in isolation, it selects the functools.lru_cache implementation. If imported in a fully integrated system (ie. Redis connection settings are available), the RedisLRU cache implementation is used.

lunkwill42 avatar Nov 26 '21 14:11 lunkwill42

Codecov Report

Merging #235 (38fd256) into develop (45e0207) will increase coverage by 0.04%. The diff coverage is 88.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #235      +/-   ##
===========================================
+ Coverage    59.64%   59.69%   +0.04%     
===========================================
  Files           62       63       +1     
  Lines         6218     6233      +15     
===========================================
+ Hits          3709     3721      +12     
- Misses        2509     2512       +3     
Impacted Files Coverage Δ
src/cnaas_nms/db/cache.py 84.21% <84.21%> (ø)
src/cnaas_nms/db/settings.py 81.08% <100.00%> (-0.20%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 45e0207...38fd256. Read the comment docs.

codecov[bot] avatar Nov 26 '21 14:11 codecov[bot]

This has actually been made redundant/obsolete by #245 - thanks @pboers1988 !

lunkwill42 avatar Sep 14 '22 13:09 lunkwill42