From 85ddf322258b96dbde40772661a39e8a7d5a32d9 Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Tue, 14 Nov 2023 19:31:28 +0200 Subject: [PATCH] Always release long-running fd on db close (#519) --- db.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db.go b/db.go index ac6564f..2306676 100644 --- a/db.go +++ b/db.go @@ -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 }