Skip to content

Commit

Permalink
Always release long-running fd on db close (benbjohnson#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
hifi authored Nov 14, 2023
1 parent ae4c991 commit 85ddf32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@ func (db *DB) Close(ctx context.Context) (err error) {
}
}

if db.f != nil {
if e := db.f.Close(); e != nil && err == nil {
err = e
}
}

return err
}

Expand Down

0 comments on commit 85ddf32

Please sign in to comment.