Fix single Redis connection being used across all threads (#18135)
* Fix single Redis connection being used across all Sidekiq threads * Fix tests
This commit is contained in:
parent
9bf04db23a
commit
3917353645
44 changed files with 243 additions and 124 deletions
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AccountSuggestions::GlobalSource < AccountSuggestions::Source
|
||||
include Redisable
|
||||
|
||||
def key
|
||||
:global
|
||||
end
|
||||
|
@ -28,7 +30,7 @@ class AccountSuggestions::GlobalSource < AccountSuggestions::Source
|
|||
end
|
||||
|
||||
def account_ids_for_locale(locale)
|
||||
Redis.current.zrevrange("follow_recommendations:#{locale}", 0, -1).map(&:to_i)
|
||||
redis.zrevrange("follow_recommendations:#{locale}", 0, -1).map(&:to_i)
|
||||
end
|
||||
|
||||
def to_ordered_list_key(account)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue