mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-18 21:06:40 +00:00
Print a warning to STDERR if Redis version is less than 2.1.3
Prior to v2.1.3, any writes to keys with an expire/TTL set were completely deleted before the write took place.
This commit is contained in:
@@ -4,6 +4,7 @@ module Redistat
|
||||
module Connection
|
||||
|
||||
REQUIRED_SERVER_VERSION = "1.3.10"
|
||||
MIN_EXPIRE_SERVER_VERSION = "2.1.3"
|
||||
|
||||
# TODO: Create a ConnectionPool instance object using Sychronize mixin to replace Connection class
|
||||
|
||||
@@ -67,6 +68,10 @@ module Redistat
|
||||
|
||||
def check_redis_version(conn)
|
||||
raise RedisServerIsTooOld if conn.info["redis_version"] < REQUIRED_SERVER_VERSION
|
||||
if conn.info["redis_version"] < MIN_EXPIRE_SERVER_VERSION
|
||||
STDOUT.puts "WARNING: You MUST upgrade Redis to v2.1.3 or later " +
|
||||
"if you are using key expiry."
|
||||
end
|
||||
conn
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user