Skip to content

Commit

Permalink
Change default timeout of asynchronous tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Feb 27, 2025
1 parent 0fde79d commit a2f976e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add `catalystcenter_ntp_settings` resource and data source
- Add `catalystcenter_telemetry_settings` resource and data source
- Add `catalystcenter_timezone_settings` resource and data source
- Changed default timeout of asynchronous tasks to 180 seconds

## 0.1.19

Expand Down
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description: |-
- Add `catalystcenter_ntp_settings` resource and data source
- Add `catalystcenter_telemetry_settings` resource and data source
- Add `catalystcenter_timezone_settings` resource and data source
- Changed default timeout of asynchronous tasks to 180 seconds

## 0.1.19

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ provider "catalystcenter" {
### Optional

- `insecure` (Boolean) Allow insecure HTTPS client. This can also be set as the CC_INSECURE environment variable. Defaults to `true`.
- `max_timeout` (Number) Timeout in seconds for asynchronous tasks. This can also be set as the CC_MAX_TIMEOUT environment variable. Defaults to `60`.
- `max_timeout` (Number) Timeout in seconds for asynchronous tasks. This can also be set as the CC_MAX_TIMEOUT environment variable. Defaults to `180`.
- `password` (String, Sensitive) Password for the Catalyst Center instance. This can also be set as the CC_PASSWORD environment variable.
- `retries` (Number) Number of retries for REST API calls. This can also be set as the CC_RETRIES environment variable. Defaults to `3`.
- `url` (String) URL of the Catalyst Center instance. This can also be set as the CC_URL environment variable.
Expand Down
4 changes: 2 additions & 2 deletions gen/templates/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (p *CcProvider) Schema(ctx context.Context, req provider.SchemaRequest, res
},
},
"max_timeout": schema.Int64Attribute{
MarkdownDescription: "Timeout in seconds for asynchronous tasks. This can also be set as the CC_MAX_TIMEOUT environment variable. Defaults to `60`.",
MarkdownDescription: "Timeout in seconds for asynchronous tasks. This can also be set as the CC_MAX_TIMEOUT environment variable. Defaults to `180`.",
Optional: true,
Validators: []validator.Int64{
int64validator.Between(0, 3600),
Expand Down Expand Up @@ -244,7 +244,7 @@ func (p *CcProvider) Configure(ctx context.Context, req provider.ConfigureReques
if config.MaxTimeout.IsNull() {
maxTimeoutStr := os.Getenv("CC_MAX_TIMEOUT")
if maxTimeoutStr == "" {
maxTimeout = 60
maxTimeout = 180
} else {
maxTimeout, _ = strconv.ParseInt(maxTimeoutStr, 0, 64)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (p *CcProvider) Schema(ctx context.Context, req provider.SchemaRequest, res
},
},
"max_timeout": schema.Int64Attribute{
MarkdownDescription: "Timeout in seconds for asynchronous tasks. This can also be set as the CC_MAX_TIMEOUT environment variable. Defaults to `60`.",
MarkdownDescription: "Timeout in seconds for asynchronous tasks. This can also be set as the CC_MAX_TIMEOUT environment variable. Defaults to `180`.",
Optional: true,
Validators: []validator.Int64{
int64validator.Between(0, 3600),
Expand Down Expand Up @@ -242,7 +242,7 @@ func (p *CcProvider) Configure(ctx context.Context, req provider.ConfigureReques
if config.MaxTimeout.IsNull() {
maxTimeoutStr := os.Getenv("CC_MAX_TIMEOUT")
if maxTimeoutStr == "" {
maxTimeout = 60
maxTimeout = 180
} else {
maxTimeout, _ = strconv.ParseInt(maxTimeoutStr, 0, 64)
}
Expand Down
1 change: 1 addition & 0 deletions templates/guides/changelog.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description: |-
- Add `catalystcenter_ntp_settings` resource and data source
- Add `catalystcenter_telemetry_settings` resource and data source
- Add `catalystcenter_timezone_settings` resource and data source
- Changed default timeout of asynchronous tasks to 180 seconds

## 0.1.19

Expand Down

0 comments on commit a2f976e

Please sign in to comment.