From f71951457d5140fd21533cd095a9a73bc678576d Mon Sep 17 00:00:00 2001 From: Ali Najafizadeh Date: Thu, 2 May 2024 11:04:35 -0400 Subject: [PATCH] Add request context to make sure client closed connection --- client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 1d7b2e6..5dea658 100644 --- a/client/client.go +++ b/client/client.go @@ -162,7 +162,7 @@ func (c *Client) Get(ctx context.Context, consumerOpts ...bus.ConsumerOpt) iter. consumer.QueueName = header.Get("Consumer-Queue") isAutoAck := header.Get("Consumer-Ack-Strategy") == "auto" - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := context.WithCancel(req.Context()) incomings := sse.Receive(ctx, resp.Body)