aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/redis_cache_store.rb
Commit message (Collapse)AuthorAgeFilesLines
* Document redis: Object optionSteven Harman2019-04-181-5/+7
| | | | | | | There are four ways to pass the redis option, but only three were documented. This is now consistent with implementation. [ci skip]
* Redis fetch without names returns {}David Verhasselt2019-04-121-0/+1
| | | | | | | When trying to call mget in Redis without any parameters, a Redis error is thrown. To avoid this, we circumvent Redis entirely when there are no key names given.
* Switch to supports_cache_versioning? check to a class methodschneems2018-09-201-4/+2
| | | | | - Moving the `supports_cache_versioning?` check to a class method. - Shorten the method doc. - Expand on the error message.
* [close #33907] Error when using "recyclable" cache keys with a store that ↵schneems2018-09-201-0/+7
| | | | | | | | | | | | | | does not support it If you are using the "in cache versioning" also known as "recyclable cache keys" the cache store must be aware of this scheme, otherwise you will generate cache entries that never invalidate. This PR adds a check to the initialization process to ensure that if recyclable cache keys are being used via ``` config.active_record.cache_versioning = true ``` Then the cache store needs to show that it supports this versioning scheme. Cache stores can let Rails know that they support this scheme by adding a method `supports_in_cache_versioning?` and returning true.
* Refactor #33254.Kasper Timm Hansen2018-07-011-16/+16
| | | | | | | | | | | | | Firstly, increment and decrement shouldn't care about the particulars of key expiry. They should only know that they have to pass that responsibility on to somewhere else. Secondly, it moves the key normalization back inside the instrumentation like it was originally. I think that matches the original design intention or at the very least it lets users catch haywire key truncation. Thirdly, it moves the changelog entry to the top of the file, where new entries go. I couldn't understand what the entry was saying so I tried to rewrite it.
* Fix Cache :redis_store increment/decrement ttl check and add more tests.Jason Lee2018-06-301-2/+2
|
* Add :expires_in option support for RedisCacheStore increment/decrement method.Jason Lee2018-06-291-2/+22
|
* Redis cache store: avoid blocking the server in `#delete_matched`Gleb Mazovetskiy2018-04-181-6/+13
| | | | | | | | | | | | | | | | | | | | Fixes #32610. Closes #32614. Lua scripts in redis are *blocking*, meaning that no other client can execute any commands while the script is running. See https://redis.io/commands/eval#atomicity-of-scripts. This results in the following exceptions once the number of keys is sufficiently large: BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE. This commit replaces the lua-based implementation with one that uses `SCAN` and `DEL` in batches. This doesn't block the server. The primary limitation of `SCAN`, i.e. potential duplicate keys, is of no consequence here, because `DEL` ignores keys that do not exist.
* Fix redis store clear keys outside the namespaceRei2018-04-151-1/+1
| | | | | | | | | | Namespace not working in RedisCacheStore#clear method. Bacause namespace = merged_options(options)[namespace] is always nil, Correct is namespace = merged_options(options)[:namespace]
* Fix unclosed tags in `RedisCacheStore` docs [ci skip]yuuji.yaginuma2018-03-191-1/+1
|
* Redis cache store: fix constructing with a Redis instanceAdam Richardson2018-03-121-1/+1
| | | | | | | | Since `Redis#call` duck types as a Proc, we'd call `#call` on it, thinking it's a Proc. Fixed by check for the Proc explicitly instead of duck typing on `#call`. References #32233
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-171-1/+0
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Merge pull request #31866 from fatkodima/redis_cache-connection_poolRafael Mendonça França2018-02-141-11/+29
|\ | | | | | | Add support for connection pooling on RedisCacheStore
| * Add support for connection pooling on RedisCacheStorefatkodima2018-02-011-11/+29
| |
* | Doc: fixes typo `cache:` -> `compress:`Joseph Page2018-02-121-1/+1
| | | | | | | | | | | | [ci skip] Closes #31967
* | Use Redis#mget for RedisCacheStore#fetch_multifatkodima2018-02-051-0/+8
| |
* | Add missing instrumentation to RedisCacheStore#read_multifatkodima2018-02-051-1/+5
| |
* | Redis cache store: consolidate serializationJeremy Daer2018-02-041-17/+21
| | | | | | | | Use `serialize_entry` throughout and introduce `serialize_entries`.
* | RedisCacheStore: fix `#write_multi` mset serializationfatkodima2018-02-041-1/+8
|/ | | | | Closes #31886 Fixes #31884
* Revert "Merge pull request #31447 from fatkodima/redis_cache-connection_pool"George Claghorn2018-01-311-52/+12
| | | | | This reverts commit ac74e2c521f6ddc0eac02d74a1313261bcc1d60f, reversing changes made to ffdb06136152b3c5f7f4a93ca5928e16e755d228.
* Improve fault tolerance for redis cache storefatkodima2018-01-231-4/+11
|
* Add support for connection pooling on RedisCacheStorefatkodima2018-01-221-12/+52
|
* Convert keys to binary in the Redis cache storeGeorge Claghorn2018-01-171-1/+1
| | | | Fix encoding errors when using the pure-Ruby Redis driver instead of Hiredis. Dodge incompatibilities between UTF-8 and arbitrary value encodings, which rear their heads when the Redis driver tries to build a single command string from incompatibly-encoded keys and values.
* Fix constant referenceGeorge Claghorn2018-01-161-1/+1
| | | | Update the long key handling test so it triggers truncation in the Redis cache store.
* RedisCacheStore - Fix Default Error HandlerJesse Doyle2017-12-141-3/+5
| | | | | | | | | * The `DEFAULT_ERROR_HANDLER` constant in `ActiveSupport::Cache::RedisCacheStore` contained references to an undefined argument `e`, which is supposed to refer to the `exception` parameter. * Update the default error handler proc to correctly reference the `exception` parameter.
* Update incorrect backtick usage in RDoc to teletypeT.J. Schuck2017-11-221-5/+5
| | | [ci skip]
* Generate `keys` instead of `keys_to_names`Ryuta Kamizono2017-11-201-3/+3
| | | | `keys_to_names` is used only for `keys_to_names.keys`.
* Fix "warning: assigned but unused variable - key"yuuji.yaginuma2017-11-181-1/+1
| | | | Ref: https://travis-ci.org/rails/rails/jobs/303840778#L1974
* Built-in Redis cache storeJeremy Daer2017-11-131-0/+404
* Supports vanilla Redis, hiredis, and Redis::Distributed. * Supports Memcached-like sharding across Redises with Redis::Distributed. * Fault tolerant. If the Redis server is unavailable, no exceptions are raised. Cache fetches are treated as misses and writes are dropped. * Local cache. Hot in-memory primary cache within block/middleware scope. * `read_/write_multi` support for Redis mget/mset. Use Redis::Distributed 4.0.1+ for distributed mget support. * `delete_matched` support for Redis KEYS globs.