Browse Source

delete old file first on windows

fix https://github.com/chrislusf/seaweedfs/issues/1210
pull/1213/head
Chris Lu 5 years ago
parent
commit
f87f2045b3
  1. 5
      weed/storage/volume_vacuum.go

5
weed/storage/volume_vacuum.go

@ -3,6 +3,7 @@ package storage
import (
"fmt"
"os"
"runtime"
"time"
"github.com/chrislusf/seaweedfs/weed/glog"
@ -111,6 +112,10 @@ func (v *Volume) CommitCompact() error {
return e
}
} else {
if runtime.GOOS == "windows" {
os.RemoveAll(v.FileName() + ".dat")
os.RemoveAll(v.FileName() + ".idx")
}
var e error
if e = os.Rename(v.FileName()+".cpd", v.FileName()+".dat"); e != nil {
return fmt.Errorf("rename %s: %v", v.FileName()+".cpd", e)

Loading…
Cancel
Save