diff --git a/controller/aofshrink.go b/controller/aofshrink.go index 05654c21..3cfac7b5 100644 --- a/controller/aofshrink.go +++ b/controller/aofshrink.go @@ -169,12 +169,12 @@ func (c *Controller) aofshrink() { ) }() - } - if len(aofbuf) > maxchunk { - if _, err := f.Write(aofbuf); err != nil { - return err + if len(aofbuf) > maxchunk { + if _, err := f.Write(aofbuf); err != nil { + return err + } + aofbuf = aofbuf[:0] } - aofbuf = aofbuf[:0] } }