aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJesse Doyle <jdoyle@ualberta.ca>2017-12-13 20:49:48 -0700
committerJeremy Daer <jeremydaer@gmail.com>2017-12-14 16:57:31 -0700
commit36291970341057bbf5f818d5ee0c5e77ab14a308 (patch)
tree122ffd7d99b8ebe455490ca95a95e6f831a8714c /activesupport
parentedc54fd2068bc21f0d381228e55d97e32f508923 (diff)
downloadrails-36291970341057bbf5f818d5ee0c5e77ab14a308.tar.gz
rails-36291970341057bbf5f818d5ee0c5e77ab14a308.tar.bz2
rails-36291970341057bbf5f818d5ee0c5e77ab14a308.zip
RedisCacheStore - Fix Default Error Handler
* 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.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/cache/redis_cache_store.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb
index 3cf002f67e..6cc45f5284 100644
--- a/activesupport/lib/active_support/cache/redis_cache_store.rb
+++ b/activesupport/lib/active_support/cache/redis_cache_store.rb
@@ -47,9 +47,11 @@ module ActiveSupport
reconnect_attempts: 0,
}
- DEFAULT_ERROR_HANDLER = -> (method:, returning:, exception:) {
- logger.error { "RedisCacheStore: #{method} failed, returned #{returning.inspect}: #{e.class}: #{e.message}" } if logger
- }
+ DEFAULT_ERROR_HANDLER = -> (method:, returning:, exception:) do
+ if logger
+ logger.error { "RedisCacheStore: #{method} failed, returned #{returning.inspect}: #{exception.class}: #{exception.message}" }
+ end
+ end
DELETE_GLOB_LUA = "for i, name in ipairs(redis.call('KEYS', ARGV[1])) do redis.call('DEL', name); end"
private_constant :DELETE_GLOB_LUA