From 77253345528288afc5b4e9f7e02ec78d31224cd7 Mon Sep 17 00:00:00 2001 From: Lalit Deore Date: Mon, 9 Mar 2026 19:45:55 +0530 Subject: [PATCH] fix - timeout issue --- health.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/health.go b/health.go index 2e05fa05..3f529742 100644 --- a/health.go +++ b/health.go @@ -131,7 +131,7 @@ func RunOpsAppHealthCheck(apiKey string, orgId string) (AppHealth, error) { } // send the request - client := &http.Client{} + client := &http.Client{Timeout: 60 * time.Second} resp, err := client.Do(req) if err != nil { log.Printf("[ERROR] Failed sending HTTP request: %s", err) @@ -204,7 +204,7 @@ func RunOpsAppHealthCheck(apiKey string, orgId string) (AppHealth, error) { req.Header.Set("Authorization", "Bearer "+apiKey) // send the request - client = &http.Client{} + client = &http.Client{Timeout: 60 * time.Second} resp, err = client.Do(req) if err != nil { log.Printf("[ERROR] Failed sending the app validate HTTP request: %s", err) @@ -289,7 +289,7 @@ func RunOpsAppHealthCheck(apiKey string, orgId string) (AppHealth, error) { req.Header.Set("Authorization", "Bearer "+apiKey) // send the request - client = &http.Client{} + client = &http.Client{Timeout: 60 * time.Second} resp, err = client.Do(req) if err != nil { log.Printf("[ERROR] Failed sending health check app verify HTTP request: %s", err) @@ -336,7 +336,7 @@ func RunOpsAppHealthCheck(apiKey string, orgId string) (AppHealth, error) { req.Header.Set("Authorization", "Bearer "+apiKey) // send the request - client = &http.Client{} + client = &http.Client{Timeout: 60 * time.Second} resp, err = client.Do(req) if err != nil { log.Printf("[ERROR] Failed sending health check app read HTTP request: %s", err) @@ -400,7 +400,7 @@ func RunOpsAppHealthCheck(apiKey string, orgId string) (AppHealth, error) { req.Header.Set("Authorization", "Bearer "+apiKey) // send the request - client = &http.Client{} + client = &http.Client{Timeout: 60 * time.Second} resp, err = client.Do(req) if err != nil { @@ -458,7 +458,7 @@ func RunOpsAppHealthCheck(apiKey string, orgId string) (AppHealth, error) { req.Header.Set("Authorization", "Bearer "+apiKey) // send the request - client = &http.Client{} + client = &http.Client{Timeout: 60 * time.Second} resp, err = client.Do(req) if err != nil { @@ -1069,7 +1069,7 @@ func deleteOpsWorkflow(workflowHealth WorkflowHealth, apiKey string, orgId strin req.Header.Set("Org-Id", orgId) // send the request - client := &http.Client{} + client := &http.Client{Timeout: 60 * time.Second} resp, err := client.Do(req) if err != nil { @@ -1276,7 +1276,7 @@ func RunOpsWorkflow(apiKey string, orgId string, cloudRunUrl string) (WorkflowHe // send the request startTime := time.Now() - client := &http.Client{} + client := &http.Client{Timeout: 60 * time.Second} resp, err := client.Do(req) if err != nil { log.Printf("[ERROR] Failed sending health check HTTP request: %s", err) @@ -1513,7 +1513,7 @@ func RunOpsAppUpload(apiKey string, orgId string) (AppHealth, error) { req.Header.Set("Content-Type", writer.FormDataContentType()) req.Header.Set("Authorization", "Bearer "+apiKey) - client := &http.Client{} + client := &http.Client{Timeout: 60 * time.Second} res, err := client.Do(req) if err != nil { log.Printf("[ERROR] Failed sending request to app upload: %s", err) @@ -1580,7 +1580,7 @@ func RunOpsAppUpload(apiKey string, orgId string) (AppHealth, error) { req.Header.Set("Authorization", "Bearer "+apiKey) // send the request - client = &http.Client{} + client = &http.Client{Timeout: 60 * time.Second} resp, err = client.Do(req) if err != nil { @@ -1694,7 +1694,7 @@ func RunOpsAppUpload(apiKey string, orgId string) (AppHealth, error) { req.Header.Set("Authorization", "Bearer "+apiKey) // send the request - client = &http.Client{} + client = &http.Client{Timeout: 60 * time.Second} resp, err = client.Do(req) if err != nil { @@ -1785,7 +1785,7 @@ func InitOpsWorkflow(apiKey string, OrgId string) (string, error) { log.Printf("[DEBUG] Ops dashboard user found. Setting up ops workflow") - client := &http.Client{} + client := &http.Client{Timeout: 60 * time.Second} body := GetWorkflowTest() if project.Environment == "cloud" { // url := "https://shuffler.io/api/v1/workflows/602c7cf5-500e-4bd1-8a97-aa5bc8a554e6" @@ -1997,7 +1997,7 @@ func InitOpsWorkflow(apiKey string, OrgId string) (string, error) { req.Body = ioutil.NopCloser(bytes.NewBuffer(workflowDataJSON)) // send the request - client = &http.Client{} + client = &http.Client{Timeout: 60 * time.Second} resp, err = client.Do(req) if err != nil { log.Printf("[ERROR] Failed sending HTTP request: %s", err)