summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2019-03-24 10:02:07 -0700
committerJared Norman <jared@super.gd>2019-03-24 10:02:07 -0700
commit65e678ddcd32d6c5edc59c86b77800d86a5cdba3 (patch)
treebb53342ba8752b06309e59f03ad1b307ee845dd2 /lib/super_good/solidus_taxjar
parent347272600825af3119454c51dd1e43be5dd9bfbc (diff)
Make cache duration configurable
Diffstat (limited to 'lib/super_good/solidus_taxjar')
-rw-r--r--lib/super_good/solidus_taxjar/tax_calculator.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/super_good/solidus_taxjar/tax_calculator.rb b/lib/super_good/solidus_taxjar/tax_calculator.rb
index e6ac0a2..0ddd50f 100644
--- a/lib/super_good/solidus_taxjar/tax_calculator.rb
+++ b/lib/super_good/solidus_taxjar/tax_calculator.rb
@@ -116,7 +116,10 @@ module SuperGood
def cache
if !Rails.env.test?
- Rails.cache.fetch(cache_key, expires_in: 3.hours) { yield }
+ Rails.cache.fetch(
+ cache_key,
+ expires_in: SuperGood::SolidusTaxJar.cache_duration
+ ) { yield }
else
yield
end