mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-04-27 13:12:47 +00:00
Merge pull request #30 from tylertreat/nosync_option
Add NoSync field to Options
This commit is contained in:
commit
337da347fe
6
db.go
6
db.go
@ -160,6 +160,7 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) {
|
|||||||
if options == nil {
|
if options == nil {
|
||||||
options = DefaultOptions
|
options = DefaultOptions
|
||||||
}
|
}
|
||||||
|
db.NoSync = options.NoSync
|
||||||
db.NoGrowSync = options.NoGrowSync
|
db.NoGrowSync = options.NoGrowSync
|
||||||
db.MmapFlags = options.MmapFlags
|
db.MmapFlags = options.MmapFlags
|
||||||
db.NoFreelistSync = options.NoFreelistSync
|
db.NoFreelistSync = options.NoFreelistSync
|
||||||
@ -1008,6 +1009,11 @@ type Options struct {
|
|||||||
|
|
||||||
// PageSize overrides the default OS page size.
|
// PageSize overrides the default OS page size.
|
||||||
PageSize int
|
PageSize int
|
||||||
|
|
||||||
|
// NoSync sets the initial value of DB.NoSync. Normally this can just be
|
||||||
|
// set directly on the DB itself when returned from Open(), but this option
|
||||||
|
// is useful in APIs which expose Options but not the underlying DB.
|
||||||
|
NoSync bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultOptions represent the options used if nil options are passed into Open().
|
// DefaultOptions represent the options used if nil options are passed into Open().
|
||||||
|
Loading…
x
Reference in New Issue
Block a user