fix redis version detection

This commit is contained in:
mohammed jasem alaajel 2024-02-24 00:03:59 +04:00
parent 6c27228920
commit 44175e8a68
1 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,9 @@ import com.google.common.annotations.VisibleForTesting;
public class RedisUtil {
public final static int PROXY_TIMEOUT = 30;
public static final int MAJOR_VERSION = 6;
public static final int MINOR_VERSION = 6;
public static boolean isRedisVersionRight(String redisVersion) {
String[] args = redisVersion.split("\\.");
if (args.length < 2) {
@ -13,7 +16,10 @@ public class RedisUtil {
}
int major = Integer.parseInt(args[0]);
int minor = Integer.parseInt(args[1]);
return major >= 6 && minor >= 2;
if (major > MAJOR_VERSION) return true;
return major == MAJOR_VERSION && minor >= MINOR_VERSION;
}
// Ham1255: i am keeping this if some plugin uses this *IF*