Skip to content
Browse files

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.
  • Loading branch information...
1 parent c0ecf4b commit 41f53b9fbacc904497358cf78c35d58a01cfe742 @jimeh committed Apr 18, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/redistat/connection.rb
View
5 lib/redistat/connection.rb
@@ -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 @@ def connection_id(options = {})
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

0 comments on commit 41f53b9

Please sign in to comment.
Something went wrong with that request. Please try again.