chanzuckerberg / redis-memo

A Redis-based version addressable caching system. Memoize pure functions, aggregated database queries, and 3rd party API calls.
https://rubygems.org/gems/redis-memo
MIT License
33 stars 3 forks source link

[feature] Add redis memo env variable for global kill switch #59

Closed katyho closed 3 years ago

katyho commented 3 years ago

Summary

Add a global kill switch for redis-memo. This should turn off all calls to the redis cache, as well as installing the auto-invalidation classes for memoized table columns on ActiveRecord.

Testing

Tested manually on traject that this works.

codecov[bot] commented 3 years ago

Codecov Report

Merging #59 (8382ce4) into main (8492ded) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #59   +/-   ##
=======================================
  Coverage   97.31%   97.31%           
=======================================
  Files          34       34           
  Lines        2125     2126    +1     
=======================================
+ Hits         2068     2069    +1     
  Misses         57       57           
Impacted Files Coverage Δ
lib/redis_memo.rb 97.05% <100.00%> (ø)
lib/redis_memo/memoize_query.rb 97.10% <100.00%> (+0.04%) :arrow_up:

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 8492ded...8382ce4. Read the comment docs.