incrdecr_cached_counts 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cached_counts/logger.rb +12 -0
- data/lib/cached_counts/version.rb +1 -1
- data/lib/cached_counts.rb +2 -11
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a018b5815304845fe6bd35505944da125418b3e5
|
4
|
+
data.tar.gz: c1799c3ddaa64683faf943ea9e0d352177c896f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4ae781d8e7394523beb4f91cbb622f018bc9ee30a04a92cbd4e00e7bdecbeb87f93c9f87dacc6b27a41872c1b1b64f97349a4ecfb1a89043345922a8f57b699
|
7
|
+
data.tar.gz: d52e2154bc2bd201b8297b9ca32cd4b142f1a265e2f7f89b8df3b86aa4c0b8ccd79ecf76e847da13c0f86389ca017ef465ae501d330a22653fb13521e73e1862
|
data/lib/cached_counts.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'cached_counts/logger'
|
1
2
|
require 'cached_counts/dalli_check'
|
2
3
|
require 'cached_counts/connection_for'
|
3
4
|
|
@@ -241,7 +242,7 @@ module CachedCounts
|
|
241
242
|
# Ensure that other reads find something in the cache, but
|
242
243
|
# continue calculating here because the default is likely inaccurate.
|
243
244
|
fallback_value = instance_exec &race_condition_fallback
|
244
|
-
logger.warn "Setting #{fallback_value} as race_condition_fallback for #{send(key_method)}"
|
245
|
+
CachedCounts.logger.warn "Setting #{fallback_value} as race_condition_fallback for #{send(key_method)}"
|
245
246
|
Rails.cache.write(
|
246
247
|
send(key_method),
|
247
248
|
fallback_value.to_i,
|
@@ -397,16 +398,6 @@ module CachedCounts
|
|
397
398
|
end
|
398
399
|
end
|
399
400
|
|
400
|
-
def logger
|
401
|
-
@logger ||= begin
|
402
|
-
if Rails.logger.nil?
|
403
|
-
require 'logger'
|
404
|
-
Logger.new($stderr)
|
405
|
-
else
|
406
|
-
Rails.logger
|
407
|
-
end
|
408
|
-
end
|
409
|
-
end
|
410
401
|
end
|
411
402
|
end
|
412
403
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incrdecr_cached_counts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Judd
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- lib/cached_counts.rb
|
144
144
|
- lib/cached_counts/connection_for.rb
|
145
145
|
- lib/cached_counts/dalli_check.rb
|
146
|
+
- lib/cached_counts/logger.rb
|
146
147
|
- lib/cached_counts/railtie.rb
|
147
148
|
- lib/cached_counts/version.rb
|
148
149
|
- spec/caches_count_of_spec.rb
|