aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2015-05-10 09:00:53 -0600
committerBen Johnson <benbjohnson@yahoo.com>2015-05-10 09:00:53 -0600
commit2c04100eb9793f2b8541d243494e2909d2112325 (patch)
tree3faea87ce911a917c058be4c243a6a1f4192b675 /db.go
parentAdd caveat regarding endianness of data files as suggested by Raphael Geronimi. (diff)
parentAdd DB.Sync(). (diff)
downloaddedo-2c04100eb9793f2b8541d243494e2909d2112325.tar.gz
dedo-2c04100eb9793f2b8541d243494e2909d2112325.tar.xz
Merge pull request #366 from benbjohnson/sync
Add DB.Sync()
Diffstat (limited to 'db.go')
-rw-r--r--db.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/db.go b/db.go
index b2c44fb..b78640f 100644
--- a/db.go
+++ b/db.go
@@ -556,6 +556,12 @@ func (db *DB) View(fn func(*Tx) error) error {
return nil
}
+// Sync executes fdatasync() against the database file handle.
+//
+// This is not necessary under normal operation, however, if you use NoSync
+// then it allows you to force the database file to sync against the disk.
+func (db *DB) Sync() error { return fdatasync(db) }
+
// Stats retrieves ongoing performance stats for the database.
// This is only updated when a transaction closes.
func (db *DB) Stats() Stats {