mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
revert disabling FSync for non Mac (#3814)
This commit is contained in:
parent
3550692afc
commit
5b28c3f728
|
@ -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…
Reference in a new issue