mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-13 08:01:02 +00:00
wrapped fragment with buffered writer
This commit is contained in:
parent
c418d73fa7
commit
6f3c5ac51b
1 changed files with 4 additions and 2 deletions
|
|
@ -206,10 +206,11 @@ func (f *Fragment) openStorage() error {
|
|||
if err != nil {
|
||||
return err
|
||||
} else if fi.Size() == 0 {
|
||||
if _, err := f.storage.WriteTo(f.file); err != nil {
|
||||
bi := bufio.NewWriter(f.file)
|
||||
if _, err := f.storage.WriteTo(bi); err != nil {
|
||||
return fmt.Errorf("init storage file: %s", err)
|
||||
}
|
||||
|
||||
bi.Flush()
|
||||
fi, err = f.file.Stat()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -1262,6 +1263,7 @@ func (f *Fragment) snapshot() error {
|
|||
} else if err := bw.Flush(); err != nil {
|
||||
return fmt.Errorf("flush: %s", err)
|
||||
}
|
||||
bw.Flush()
|
||||
|
||||
// Close current storage.
|
||||
if err := f.closeStorage(); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue