Skip to content

Commit

Permalink
feat: put 30 seconds as default client time out
Browse files Browse the repository at this point in the history
  • Loading branch information
gitahernandez committed Feb 27, 2024
1 parent 6a83871 commit 69b20db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TestClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion api/utils/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 69b20db

Please sign in to comment.