about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--config/initializers/cache_logging.rb3
-rw-r--r--lib/mastodon/redis_config.rb1
2 files changed, 4 insertions, 0 deletions
diff --git a/config/initializers/cache_logging.rb b/config/initializers/cache_logging.rb
new file mode 100644
index 000000000..08aa80742
--- /dev/null
+++ b/config/initializers/cache_logging.rb
@@ -0,0 +1,3 @@
+# Log cache errors with Rail's logger
+# This used to be the default in old Rails versions: https://github.com/rails/rails/commit/7fcf8590e788cef8b64cc266f75931c418902ca9#diff-f0748f0be8a653eea13369ebb1cadabcad71ede7cfaf20282447e64329817befL86
+Rails.cache.logger = Rails.logger
diff --git a/lib/mastodon/redis_config.rb b/lib/mastodon/redis_config.rb
index 98dc4788d..3522fa11e 100644
--- a/lib/mastodon/redis_config.rb
+++ b/lib/mastodon/redis_config.rb
@@ -37,6 +37,7 @@ REDIS_CACHE_PARAMS = {
   namespace: cache_namespace,
   pool_size: Sidekiq.server? ? Sidekiq.options[:concurrency] : Integer(ENV['MAX_THREADS'] || 5),
   pool_timeout: 5,
+  connect_timeout: 5,
 }.freeze
 
 REDIS_SIDEKIQ_PARAMS = {