cache_failover 0.1.1 → 0.1.2
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/README.md +4 -1
- data/lib/cache_failover/store.rb +4 -0
- data/lib/cache_failover/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed9e82f26ea1cb43e4b188cee7620bb345adba1f320144e3eee891c8b6eba03c
|
4
|
+
data.tar.gz: 702f7c9c24287051704a9bc56c5a758db81d764cf5a3b26204ae3dc7b3ae529b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84a2ebf66e5e039fb714bff24879fc52aa63d76aa80434dd69f85fdcb24fbfa4763e32996288f8cc55b95dde9ef1f09693f68acacd2c1f98fe0c3137bb4b6c8d
|
7
|
+
data.tar.gz: bb2fadf0c46ecd0a4bcd28b7ffbc7535badc43aac63f23937007136a069256d508745d177113c82102a8da50f2d168cb4de1720b7595b356baa514a9c8de5ee1
|
data/README.md
CHANGED
@@ -25,6 +25,10 @@ Configure your cache_store normally, but use `CacheFailover::Store` with one arg
|
|
25
25
|
```ruby
|
26
26
|
config.cache_store = CacheFailover::Store.new(
|
27
27
|
[
|
28
|
+
{
|
29
|
+
store: ActiveSupport::Cache::MemCacheStore.new(CONFIG[:MEMCACHED_SERVERS], {}),
|
30
|
+
options: {}
|
31
|
+
},
|
28
32
|
{
|
29
33
|
store: ActiveSupport::Cache::RedisCacheStore.new(
|
30
34
|
url: CONFIG[:REDIS_URL],
|
@@ -43,7 +47,6 @@ config.cache_store = CacheFailover::Store.new(
|
|
43
47
|
```
|
44
48
|
|
45
49
|
## WIP
|
46
|
-
- Dalli/Memcached support
|
47
50
|
- Memory Cache Support
|
48
51
|
- File Cache support
|
49
52
|
- More options
|
data/lib/cache_failover/store.rb
CHANGED
@@ -185,6 +185,10 @@ module CacheFailover
|
|
185
185
|
when 'ActiveSupport::Cache::RedisCacheStore'
|
186
186
|
(redis_cnxn(init_options).call('ping') == 'PONG' rescue false)
|
187
187
|
when 'ActiveSupport::Cache::MemCacheStore'
|
188
|
+
dalli_cnxn(init_options).alive!
|
189
|
+
dalli_cnxn(init_options).delete('cache_test')
|
190
|
+
dalli_cnxn(init_options).add('cache_test', 'success')
|
191
|
+
dalli_cnxn(init_options).get('cache_test') == 'success'
|
188
192
|
when 'SolidCache::Store'
|
189
193
|
cache_db_cnxn(init_options).with_connection { ActiveRecord::Base.connection.select_value('SELECT 1=1') == 1 }
|
190
194
|
when 'ActiveSupport::Cache::MemoryStore'
|