From 41f53b9fbacc904497358cf78c35d58a01cfe742 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 18 Apr 2012 16:42:27 +0100 Subject: [PATCH] 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. --- lib/redistat/connection.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/redistat/connection.rb b/lib/redistat/connection.rb index f7dcfd9..9b3fff3 100644 --- a/lib/redistat/connection.rb +++ b/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 @@ 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