From 667a3c6ef06553ed96a42eb513a8c2bd67f6d3e0 Mon Sep 17 00:00:00 2001 From: Akmal Date: Sun, 14 Jul 2024 20:24:33 +0700 Subject: [PATCH] Close http.Client idle connection in grid --- handlers/grid.go | 1 + 1 file changed, 1 insertion(+) diff --git a/handlers/grid.go b/handlers/grid.go index 6b4f01b..7d9fbff 100644 --- a/handlers/grid.go +++ b/handlers/grid.go @@ -155,6 +155,7 @@ func Grid() fiber.Handler { var wg sync.WaitGroup images := make([]image.Image, len(mediaURLs)) client := http.Client{Transport: transport, Timeout: timeout} + defer client.CloseIdleConnections() for i, mediaURL := range mediaURLs { wg.Add(1)