Skip to content

Commit

Permalink
Don't fetch cache inside the web request. If API is slow it leads to …
Browse files Browse the repository at this point in the history
…timeouts. Background job should do the work to prevent website users from experiencing slow responses.
  • Loading branch information
Gert-Jaap Glasbergen committed Jul 23, 2017
1 parent 5090e57 commit 69311fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/exchange_rate_service.rb
Expand Up @@ -29,7 +29,7 @@ def fetch_external_data

def external_data
cache = get_cache
return cache if cache_valid?(cache)
return cache if cache.present?
fetch_external_data
end

Expand Down

0 comments on commit 69311fd

Please sign in to comment.