Skip to content

Commit

Permalink
truncate to LastCommit on open (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Preetam authored May 23, 2018
1 parent 97ec879 commit 7fd809a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lm2.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ func NewCollection(file string, cacheSize int) (*Collection, error) {
c.wal.Close()
return nil, err
}
err = c.f.Truncate(c.LastCommit)
if err != nil {
c.f.Close()
c.wal.Close()
return nil, err
}
return c, nil
}

Expand Down

0 comments on commit 7fd809a

Please sign in to comment.