From 46795d9fa79756fac793697f9abb266ccdb9feef Mon Sep 17 00:00:00 2001 From: hulk Date: Wed, 24 Apr 2024 13:33:06 +0800 Subject: [PATCH] Fix dead condidtion in LoadAppendOnlyFile (#792) --- internal/reader/parsing_aof.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/reader/parsing_aof.go b/internal/reader/parsing_aof.go index 1dc156dc..36671a51 100644 --- a/internal/reader/parsing_aof.go +++ b/internal/reader/parsing_aof.go @@ -601,15 +601,14 @@ func (aofInfo *INFO) LoadAppendOnlyFile(ctx context.Context, am *AOFManifest, AO if ret == AOFEmpty { ret = AOFOk } + if ret == AOFOk || ret == AOFTruncated { + log.Infof("The AOF File was successfully loaded") + } if ret == AOFOpenErr || ret == AOFFailed { - if ret == AOFOk || ret == AOFTruncated { - log.Infof("The AOF File was successfully loaded") + if ret == AOFOpenErr { + log.Panicf("There was an error opening the AOF File.") } else { - if ret == AOFOpenErr { - log.Panicf("There was an error opening the AOF File.") - } else { - log.Panicf("Failed to open AOF File.") - } + log.Panicf("Failed to open AOF File.") } return ret }