mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
Merge pull request #4055 from tgxworld/fix_topic_view_not_working_in_redis_readonly
FIX: Topic view not working when Redis is readonly.
This commit is contained in:
@@ -47,7 +47,12 @@ class RandomTopicSelector
|
||||
$redis.ltrim(key, count, -1)
|
||||
end
|
||||
|
||||
results = results[0]
|
||||
if !results.is_a?(Array) # Redis is in readonly mode
|
||||
results = $redis.lrange(key, 0, count-1)
|
||||
else
|
||||
results = results[0]
|
||||
end
|
||||
|
||||
results.map!(&:to_i)
|
||||
|
||||
left = count - results.length
|
||||
|
||||
Reference in New Issue
Block a user