@@ -507,9 +507,8 @@ is often faster than waiting more than a second to retrieve it. Both read and
507
507
write timeouts default to 1 second, but may be set lower if your network is
508
508
consistently low-latency.
509
509
510
- By default, the cache store will not attempt to reconnect to Redis if the
511
- connection fails during a request. If you experience frequent disconnects you
512
- may wish to enable reconnect attempts.
510
+ By default, the cache store will attempt to reconnect to Redis once if the
511
+ connection fails during a request.
513
512
514
513
Cache reads and writes never raise exceptions; they just return ` nil ` instead,
515
514
behaving as if there was nothing in the cache. To gauge whether your cache is
@@ -537,10 +536,10 @@ A more complex, production Redis cache store may look something like this:
537
536
cache_servers = %w(redis://cache-01:6379/0 redis://cache-02:6379/0)
538
537
config.cache_store = :redis_cache_store , { url: cache_servers,
539
538
540
- connect_timeout: 30 , # Defaults to 20 seconds
539
+ connect_timeout: 30 , # Defaults to 1 second
541
540
read_timeout: 0.2 , # Defaults to 1 second
542
541
write_timeout: 0.2 , # Defaults to 1 second
543
- reconnect_attempts: 1 , # Defaults to 0
542
+ reconnect_attempts: 2 , # Defaults to 1
544
543
545
544
error_handler: -> (method: , returning: , exception: ) {
546
545
# Report errors to Sentry as warnings
0 commit comments