aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/redis_cache_store.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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.