From dd06ff73e655481b3fa7f0229854a307efd6fbc4 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Tue, 14 Mar 2023 13:41:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20redis=20aof=20=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=B8=8E=E7=89=88=E6=9C=AC=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/backup_redis.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app/service/backup_redis.go b/backend/app/service/backup_redis.go index 4e3fee8de..e71f75540 100644 --- a/backend/app/service/backup_redis.go +++ b/backend/app/service/backup_redis.go @@ -121,7 +121,10 @@ func handleRedisRecover(redisInfo *repo.RootInfo, recoverFile string, isRollback } if appendonly == "yes" { - if !strings.HasSuffix(recoverFile, ".tar.gz") && !strings.HasSuffix(recoverFile, ".aof") { + if redisInfo.Version == "6.0.16" && !strings.HasSuffix(recoverFile, ".aof") { + return buserr.New(constant.ErrTypeOfRedis) + } + if redisInfo.Version == "7.0.5" && !strings.HasSuffix(recoverFile, ".tar.gz") { return buserr.New(constant.ErrTypeOfRedis) } } else {