diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2015-05-08 13:11:15 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2015-05-08 13:11:15 -0600 |
commit | e5aaa976ba0fde08de7bc7824cf057add525d2b8 (patch) | |
tree | 3faea87ce911a917c058be4c243a6a1f4192b675 | |
parent | Add caveat regarding endianness of data files as suggested by Raphael Geronimi. (diff) | |
download | dedo-e5aaa976ba0fde08de7bc7824cf057add525d2b8.tar.gz dedo-e5aaa976ba0fde08de7bc7824cf057add525d2b8.tar.xz |
Add DB.Sync().
This commit adds DB.Sync() for users who set DB.NoSync to true.
-rw-r--r-- | db.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 { |