Skip to content

Commit ced8274

Browse files
Update tools/db-bench/main.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent b54eaf3 commit ced8274

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/db-bench/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ func runProfile(p profile, dir string, cfg config) (result, error) {
133133
if err != nil {
134134
return result{}, fmt.Errorf("failed to open db: %w", err)
135135
}
136+
defer kv.Close()
136137

137138
ctx := context.Background()
138139
start := time.Now()
139140

140141
batch, err := kv.Batch(ctx)
141142
if err != nil {
142-
_ = kv.Close()
143143
return result{}, fmt.Errorf("failed to create batch: %w", err)
144144
}
145145

0 commit comments

Comments
 (0)