exchange-rates 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/exchange_rates/rate.rb +1 -1
- data/lib/exchange_rates/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2f7997cf5b23a8e2efbabf40f4d89d98210b4640f197e3302c03ac5f2f72a3d
|
4
|
+
data.tar.gz: cb35b7a6ea58f2b3213b732bb7f7b6ee2d1141153e16fe10b89496aec60530c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de2585b973295a58729984273a4c68c8b4d75884ab755d96806412afa01f1e1eb4c96f7ac2220d2e5541d4219ee81c6069959cf075224f64063b45dd70e5d7a
|
7
|
+
data.tar.gz: 12d3c62911061ae9c2eefb65bdc4b3f0997402c49f4edb09eda8e7242d8f66bb8a9d2233a727bca1906fda7ab7de38eaae842555e4b67029ad623134535f6b73
|
data/lib/exchange_rates/rate.rb
CHANGED
@@ -26,7 +26,7 @@ module ExchangeRates
|
|
26
26
|
|
27
27
|
def self.get_rate(currency)
|
28
28
|
return 1 if currency == BASE_CURRENCY
|
29
|
-
cached = Rails.cache.fetch("#{currency.downcase}_to_#{BASE_CURRENCY.downcase}", expired_at: Date.today.midnight + ENV['RESET_CACHED_CURRENCY_AT'].to_i.hours) do
|
29
|
+
cached = Rails.cache.fetch("#{currency.downcase}_to_#{BASE_CURRENCY.downcase}", expired_at: Date.today.midnight + ENV['RESET_CACHED_CURRENCY_AT'].to_i.hours, race_condition_ttl: 5) do
|
30
30
|
where(from_currency: currency).first.rate_to_base_currency
|
31
31
|
end
|
32
32
|
cached || where(from_currency: currency).first.rate_to_base_currency
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exchange-rates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aloha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: money
|
@@ -142,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
|
146
|
-
rubygems_version: 2.7.7
|
145
|
+
rubygems_version: 3.0.4
|
147
146
|
signing_key:
|
148
147
|
specification_version: 4
|
149
148
|
summary: Rails ExchangeRates Helper
|