From 69b20db73857d5fef01e5e1d9db5e95509ecab51 Mon Sep 17 00:00:00 2001 From: "EPAM\\Felipe_Hernandez" Date: Tue, 27 Feb 2024 11:47:22 -0500 Subject: [PATCH] feat: put 30 seconds as default client time out --- TestClient.go | 2 +- api/utils/validator.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/TestClient.go b/TestClient.go index 8cad762..98e8d66 100644 --- a/TestClient.go +++ b/TestClient.go @@ -33,7 +33,7 @@ func main() { retryMaxElapsedTimeMinutes := 2 // validate inputs - errorsInInputs := utils.ValidateInputs(clientId, clientSecret, apiUrl, clientTimeOutInSeconds, &separator, verifyCa, zapLogger, certificate, certificateKey) + errorsInInputs := utils.ValidateInputs(clientId, clientSecret, apiUrl, clientTimeOutInSeconds, &separator, verifyCa, zapLogger, certificate, certificateKey, &retryMaxElapsedTimeMinutes) if errorsInInputs != nil { return diff --git a/api/utils/validator.go b/api/utils/validator.go index c942689..69f3875 100644 --- a/api/utils/validator.go +++ b/api/utils/validator.go @@ -24,10 +24,12 @@ type UserInputValidaton struct { var validate *validator.Validate // ValidateInputs is responsible for validating end-user inputs. -func ValidateInputs(clientId string, clientSecret string, apiUrl string, clientTimeOutinSeconds int, separator *string, verifyCa bool, logger logging.Logger, certificate string, certificate_key string) error { +func ValidateInputs(clientId string, clientSecret string, apiUrl string, clientTimeOutinSeconds int, separator *string, verifyCa bool, logger logging.Logger, certificate string, certificate_key string, retryMaxElapsedTimeMinutes *int) error { if clientTimeOutinSeconds == 0 { clientTimeOutinSeconds = 30 + *retryMaxElapsedTimeMinutes = 2 + } validate = validator.New(validator.WithRequiredStructEnabled())