Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
fix/ remove uncertain time_to_idle cache-option
Browse files Browse the repository at this point in the history
This options is not [universal](https://github.com/rails/rails/blob/5-2-stable/activesupport/lib/active_support/cache.rb#L23)
And supports only by `ehcache` Java (& JRuby) store
  • Loading branch information
Alexey Suslyakov committed Mar 16, 2018
1 parent d943a89 commit 294bf7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/spree/calculator/avalara_transaction_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def prev_tax_amount(item)
end

def get_avalara_response(order)
Rails.cache.fetch(cache_key(order), time_to_idle: 5.minutes) do
Rails.cache.fetch(cache_key(order)) do
order.avalara_capture
end
end
Expand Down Expand Up @@ -72,7 +72,7 @@ def cache_key_with_short_hash(order)
alias_method :cache_key, :cache_key_with_short_hash

def retrieve_rates_from_cache(order)
Rails.cache.fetch(cache_key(order), time_to_idle: 5.minutes) do
Rails.cache.fetch(cache_key(order)) do
# this is the fallback value written to the cache if there is no value
order.avalara_capture
end
Expand Down

0 comments on commit 294bf7d

Please sign in to comment.