mirror of
https://github.com/tendermint/tendermint.git
synced 2026-06-03 12:56:22 +00:00
autofile: ensure file is open in Sync
This commit is contained in:
@@ -103,6 +103,11 @@ func (af *AutoFile) Sync() error {
|
||||
af.mtx.Lock()
|
||||
defer af.mtx.Unlock()
|
||||
|
||||
if af.file == nil {
|
||||
if err := af.openFile(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return af.file.Sync()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user