about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-11-28 11:33:34 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-11-28 11:33:34 +0100
commita2e7997592dd86baa7595c41eed274be4c200d07 (patch)
treeb4c21af8bdf541d8156beb29e9f53766bd1fbadd /lib
parent6517b7b9f02f8590a8f9c5aa04e3ef9efeb4e757 (diff)
parentcec1e902e006730f68bde0a4334e5b819a12a475 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Our README is completely different.
  Discarded upstream changes.
Diffstat (limited to 'lib')
-rw-r--r--lib/enumerable.rb26
-rw-r--r--lib/mastodon/redis_config.rb1
2 files changed, 1 insertions, 26 deletions
diff --git a/lib/enumerable.rb b/lib/enumerable.rb
deleted file mode 100644
index 66918f65e..000000000
--- a/lib/enumerable.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-module Enumerable
-  # TODO: Remove this once stop to support Ruby 2.6
-  if RUBY_VERSION < '2.7.0'
-    def filter_map
-      if block_given?
-        result = []
-        each do |element|
-          res = yield element
-          result << res if res
-        end
-        result
-      else
-        Enumerator.new do |yielder|
-          result = []
-          each do |element|
-            res = yielder.yield element
-            result << res if res
-          end
-          result
-        end
-      end
-    end
-  end
-end
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 = {