Browse Source

revert disabling FSync for non Mac (#3814)

pull/3815/head
Konstantin Lebedev 2 years ago
committed by GitHub
parent
commit
5b28c3f728
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      weed/storage/backend/disk_file.go

12
weed/storage/backend/disk_file.go

@ -4,6 +4,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/glog"
. "github.com/seaweedfs/seaweedfs/weed/storage/types"
"os"
"runtime"
"time"
)
@ -11,6 +12,8 @@ var (
_ BackendStorageFile = &DiskFile{}
)
const isMac = runtime.GOOS == "darwin"
type DiskFile struct {
File *os.File
fullFilePath string
@ -81,6 +84,11 @@ func (df *DiskFile) Name() string {
}
func (df *DiskFile) Sync() error {
return nil
// return df.File.Sync()
if df.File == nil {
return os.ErrInvalid
}
if isMac {
return nil
}
return df.File.Sync()
}
Loading…
Cancel
Save