Skip to content

Commit

Permalink
Merge pull request #86 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
chore: Update retry wait time and max wait time in SetDNACWaitTimeToM…
  • Loading branch information
bvargasre authored Jul 17, 2024
2 parents 2a9d86c + 087fc37 commit bb9bb15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [5.0.31] - 2024-07-17
### Changed
- Method `SetDNACWaitTimeToManyRequest` update for update wait time from minutes to seconds.

## [5.0.30] - 2024-06-26
### Fixed
- Fix functions name in `DevicesService`, `EoXService`, `HealthAndPerformanceService`, `SystemSettingsService` and `UserandRolesService`
Expand Down Expand Up @@ -637,4 +641,5 @@ Services removed on Cisco DNA Center 2.3.3.0's API:
[5.0.28]: https://github.com/cisco-en-programmability/dnacenter-go-sdk/compare/v5.0.27...v5.0.28
[5.0.29]: https://github.com/cisco-en-programmability/dnacenter-go-sdk/compare/v5.0.28...v5.0.29
[5.0.30]: https://github.com/cisco-en-programmability/dnacenter-go-sdk/compare/v5.0.29...v5.0.30
[Unreleased]: https://github.com/cisco-en-programmability/dnacenter-go-sdk/compare/v5.0.30...main
[5.0.31]: https://github.com/cisco-en-programmability/dnacenter-go-sdk/compare/v5.0.30...v5.0.31
[Unreleased]: https://github.com/cisco-en-programmability/dnacenter-go-sdk/compare/v5.0.31...main
11 changes: 7 additions & 4 deletions sdk/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,19 @@ func (s *Client) SetDNACWaitTimeToManyRequest(waitTimeToManyRequest int) error {
if err != nil {
return err
}
if waitTimeToManyRequest <= 0 {
waitTimeToManyRequest = 15 // 15s
}
s.common.client.
// Set retry count to non zero to enable retries
SetRetryCount(1).
// You can override initial retry wait time.
// Default is 100 milliseconds.
SetRetryWaitTime(time.Duration(waitTimeToManyRequest) * time.Minute).
SetRetryWaitTime(time.Duration(waitTimeToManyRequest) * time.Second).
// MaxWaitTime can be overridden as well.
// Default is 2 seconds.
SetRetryMaxWaitTime(time.Duration(waitTimeToManyRequest+1) * time.Minute)
return err
// Default is 2 secounds.
SetRetryMaxWaitTime(time.Duration(waitTimeToManyRequest+1) * time.Second)
return nil
}

func statusIsFailure(status string) bool {
Expand Down

0 comments on commit bb9bb15

Please sign in to comment.