mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 14:14:21 +01:00
kvdb/postgres: fix context cancellation
This commit is contained in:
@@ -158,21 +158,11 @@ func (tx *readWriteTx) OnCommit(cb func()) {
|
||||
}
|
||||
|
||||
// QueryRow executes a QueryRow call with a timeout context.
|
||||
func (tx *readWriteTx) QueryRow(query string, args ...interface{}) *sql.Row {
|
||||
ctx, cancel := tx.db.getTimeoutCtx()
|
||||
defer cancel()
|
||||
|
||||
return tx.tx.QueryRowContext(ctx, query, args...)
|
||||
}
|
||||
|
||||
// Query executes a Query call with a timeout context.
|
||||
func (tx *readWriteTx) Query(query string, args ...interface{}) (*sql.Rows,
|
||||
error) {
|
||||
func (tx *readWriteTx) QueryRow(query string, args ...interface{}) (*sql.Row,
|
||||
func()) {
|
||||
|
||||
ctx, cancel := tx.db.getTimeoutCtx()
|
||||
defer cancel()
|
||||
|
||||
return tx.tx.QueryContext(ctx, query, args...)
|
||||
return tx.tx.QueryRowContext(ctx, query, args...), cancel
|
||||
}
|
||||
|
||||
// Exec executes a Exec call with a timeout context.
|
||||
|
||||
Reference in New Issue
Block a user