Flush to file periodically

This commit is contained in:
Alex Roitman 2017-12-11 16:12:15 -08:00
parent 5945ae2a68
commit 28aebe856f
1 changed files with 5 additions and 5 deletions

View File

@ -169,12 +169,12 @@ func (c *Controller) aofshrink() {
) )
}() }()
} if len(aofbuf) > maxchunk {
if len(aofbuf) > maxchunk { if _, err := f.Write(aofbuf); err != nil {
if _, err := f.Write(aofbuf); err != nil { return err
return err }
aofbuf = aofbuf[:0]
} }
aofbuf = aofbuf[:0]
} }
} }