Skip to content

Commit

Permalink
close rows
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianH committed Jan 4, 2024
1 parent 421cb6f commit 94fe617
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ func (db *DB) InsertRewards(ctx context.Context, rowsToInsert [][]interface{}) e
)
if err != nil || count < int64(len(rowsToInsert)) {
const sql = `DELETE FROM rewards WHERE block = $1;`
_, errD := db.Postgres.Query(ctx, sql, rowsToInsert[0][0])
rows, errD := db.Postgres.Query(ctx, sql, rowsToInsert[0][0])
defer rows.Close()
if db.checkErr(errD) != nil {
return db.checkErr(errD)
}
Expand Down

0 comments on commit 94fe617

Please sign in to comment.