Fix aofshrink crash on windows

closes #318
This commit is contained in:
Josh Baker 2018-05-25 11:50:31 -07:00
parent f4bfc0d52f
commit 96db984e09
1 changed files with 3 additions and 0 deletions

View File

@ -258,6 +258,9 @@ func (c *Controller) aofshrink() {
if err := c.aof.Close(); err != nil { if err := c.aof.Close(); err != nil {
log.Fatalf("shrink live aof close fatal operation: %v", err) log.Fatalf("shrink live aof close fatal operation: %v", err)
} }
if err := f.Close(); err != nil {
log.Fatalf("shrink new aof close fatal operation: %v", err)
}
if err := os.Rename(core.AppendFileName, core.AppendFileName+"-bak"); err != nil { if err := os.Rename(core.AppendFileName, core.AppendFileName+"-bak"); err != nil {
log.Fatalf("shrink backup fatal operation: %v", err) log.Fatalf("shrink backup fatal operation: %v", err)
} }