(path string, opt graph.Options)
| 57 | } |
| 58 | |
| 59 | func Open(path string, opt graph.Options) (hkv.KV, error) { |
| 60 | db, err := bolt.Open(getBoltFile(path), nil) |
| 61 | if err != nil { |
| 62 | clog.Errorf("Error, couldn't open! %v", err) |
| 63 | return nil, err |
| 64 | } |
| 65 | bdb := db.DB() |
| 66 | // BoolKey returns false on non-existence. IE, Sync by default. |
| 67 | bdb.NoSync, err = opt.BoolKey("nosync", false) |
| 68 | if err != nil { |
| 69 | db.Close() |
| 70 | return nil, err |
| 71 | } |
| 72 | bdb.NoGrowSync = bdb.NoSync |
| 73 | if bdb.NoSync { |
| 74 | clog.Infof("Running in nosync mode") |
| 75 | } |
| 76 | return db, nil |
| 77 | } |
nothing calls this directly
no test coverage detected