From fb76ae5be20f64286b4f0df003f7e2c66c04b3d9 Mon Sep 17 00:00:00 2001 From: MSarthak Date: Fri, 18 Aug 2023 15:11:42 +0530 Subject: [PATCH] Sarthak | WorkerGroup now establishes a new connection even if the existing connection is nil --- workers/worker_group.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workers/worker_group.go b/workers/worker_group.go index 32d0c60..8b4dc4c 100644 --- a/workers/worker_group.go +++ b/workers/worker_group.go @@ -64,7 +64,7 @@ func (group *WorkerGroup) runWorkers( var connection net.Conn for count := 0; count < int(group.options.concurrency); count++ { - if count%int(connectionsSharedByWorker) == 0 { + if count%int(connectionsSharedByWorker) == 0 || connection == nil { connection, _ = group.newConnection() // TODO: Handle error if group.responseReader != nil && connection != nil {