From 82bf31182fc42e77e5b71e7b1eacaed08335d680 Mon Sep 17 00:00:00 2001 From: Aykhan Shahsuvarov Date: Tue, 10 Sep 2024 03:35:43 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Remove=20interrupt=20errors=20fr?= =?UTF-8?q?om=20responses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requests/requests.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/requests/requests.go b/requests/requests.go index 73a1e85..28ef90e 100644 --- a/requests/requests.go +++ b/requests/requests.go @@ -210,18 +210,20 @@ func sendRequest( } func() { - defer func() { increase <- 1 }() - startTime := time.Now() response, err := clientDo(ctx, request) completedTime := time.Since(startTime) if err != nil { + if err == customerrors.ErrInterrupt { + return + } *responseData = append(*responseData, Response{ StatusCode: 0, Error: err, Time: completedTime, }) + increase <- 1 return } defer fasthttp.ReleaseResponse(response) @@ -231,6 +233,7 @@ func sendRequest( Error: nil, Time: completedTime, }) + increase <- 1 }() } }