mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-05-31 22:58:32 +00:00
[bugfix] defer rows.Close() when using QueryContext
This commit is contained in:
parent
65b5366031
commit
2bb3eb9608
|
@ -218,6 +218,7 @@ func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, erro
|
|||
func (c *SQLiteConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (rows driver.Rows, err error) {
|
||||
err = retryOnBusy(ctx, func() error {
|
||||
rows, err = c.conn.QueryContext(ctx, query, args)
|
||||
defer rows.Close()
|
||||
err = processSQLiteError(err)
|
||||
return err
|
||||
})
|
||||
|
@ -276,6 +277,7 @@ func (stmt *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error) {
|
|||
func (stmt *SQLiteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error) {
|
||||
err = retryOnBusy(ctx, func() error {
|
||||
rows, err = stmt.stmt.QueryContext(ctx, args)
|
||||
defer rows.Close()
|
||||
err = processSQLiteError(err)
|
||||
return err
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue