Skip to content

Commit

Permalink
pager: on Close method ensure all writes are flushed to disk via esca…
Browse files Browse the repository at this point in the history
…lation
  • Loading branch information
guycipher committed Nov 5, 2024
1 parent 46a443e commit 4ff524f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pager/pager.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ func (p *Pager) Close() error {

p.wg.Wait()

// Ensure all pending writes are flushed to disk
if err := p.file.Sync(); err != nil {
return err
}

if p != nil {
return p.file.Close()
}
Expand Down

0 comments on commit 4ff524f

Please sign in to comment.