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
// find out db state we should open at
at := opt.At
if at == 0 {
if opt.NoSync {
db.mu.Lock()
at = db.δtail.Head()
db.mu.Unlock()
} else {
if !opt.NoSync {
// sync storage for head
err = db.stor.Sync(ctx)
if err != nil {
return nil, err
}
at = db.stor.Head()
}
at = db.stor.Head()
}
// 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