PERF: Use Redis SET EX GET instead of LUA script for counting (#15939)

This will prevent Discourse from booting on Redis < 6.2.0
This commit is contained in:
Rafael dos Santos Silva
2022-02-15 10:36:07 -03:00
committed by GitHub
parent a48231041b
commit 4d3da70bc6
4 changed files with 10 additions and 14 deletions

View File

@ -8,3 +8,8 @@ end
# Pending https://github.com/MiniProfiler/rack-mini-profiler/pull/450 and
# upgrade to Sidekiq 6.1
Redis.exists_returns_integer = true
if Gem::Version.new(Discourse.redis.info['redis_version']) < Gem::Version.new("6.2.0")
STDERR.puts "Discourse requires Redis 6.2.0 or up"
exit 1
end