diff --git a/pager/pager.go b/pager/pager.go index 7f219b0..5e95ac2 100644 --- a/pager/pager.go +++ b/pager/pager.go @@ -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() }