aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/tx.go b/tx.go
index 62b9be6..c041d73 100644
--- a/tx.go
+++ b/tx.go
@@ -425,8 +425,8 @@ func (tx *Tx) write() error {
// Update statistics.
tx.stats.Write++
}
- if !tx.db.NoSync {
- if err := fdatasync(tx.db.file); err != nil {
+ if !tx.db.NoSync || IgnoreNoSync {
+ if err := fdatasync(tx.db); err != nil {
return err
}
}
@@ -448,8 +448,8 @@ func (tx *Tx) writeMeta() error {
if _, err := tx.db.ops.writeAt(buf, int64(p.id)*int64(tx.db.pageSize)); err != nil {
return err
}
- if !tx.db.NoSync {
- if err := fdatasync(tx.db.file); err != nil {
+ if !tx.db.NoSync || IgnoreNoSync {
+ if err := fdatasync(tx.db); err != nil {
return err
}
}