1
0
mirror of https://github.com/jackc/pgx.git synced 2025-04-28 14:07:51 +00:00

SendBatch should pass ctx to StartPipeline

https://github.com/jackc/pgx/issues/1748
This commit is contained in:
Jack Christensen 2023-09-28 20:00:02 -05:00
parent d93f31b8fa
commit a61517a83b

@ -1090,7 +1090,7 @@ func (c *Conn) sendBatchQueryExecModeDescribeExec(ctx context.Context, b *Batch)
} }
func (c *Conn) sendBatchExtendedWithDescription(ctx context.Context, b *Batch, distinctNewQueries []*pgconn.StatementDescription, sdCache stmtcache.Cache) (pbr *pipelineBatchResults) { func (c *Conn) sendBatchExtendedWithDescription(ctx context.Context, b *Batch, distinctNewQueries []*pgconn.StatementDescription, sdCache stmtcache.Cache) (pbr *pipelineBatchResults) {
pipeline := c.pgConn.StartPipeline(context.Background()) pipeline := c.pgConn.StartPipeline(ctx)
defer func() { defer func() {
if pbr != nil && pbr.err != nil { if pbr != nil && pbr.err != nil {
pipeline.Close() pipeline.Close()