Commit e5e5879b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 99036f9c
...@@ -377,18 +377,14 @@ func (db *DB) Open(ctx context.Context, opt *ConnOptions) (_ *Connection, err er ...@@ -377,18 +377,14 @@ func (db *DB) Open(ctx context.Context, opt *ConnOptions) (_ *Connection, err er
// find out db state we should open at // find out db state we should open at
at := opt.At at := opt.At
if at == 0 { if at == 0 {
if opt.NoSync { if !opt.NoSync {
db.mu.Lock()
at = db.δtail.Head()
db.mu.Unlock()
} else {
// sync storage for head // sync storage for head
err = db.stor.Sync(ctx) err = db.stor.Sync(ctx)
if err != nil { if err != nil {
return nil, err return nil, err
} }
at = db.stor.Head()
} }
at = db.stor.Head()
} }
// wait for db.Head ≥ at // wait for db.Head ≥ at
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment