Skip to content

Commit

Permalink
chore: migrate MaxConcurrency to ContainerScalingOption.ConcurrentReq…
Browse files Browse the repository at this point in the history
…uestsThreshold
  • Loading branch information
remyleone committed Nov 26, 2024
1 parent 6f6860e commit d156e34
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ linters:
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
- dupl # Tool for code clone detection [fast: true, auto-fix: false]
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false]
- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false]
- exhaustive # check exhaustiveness of enum switch statements [fast: false, auto-fix: false]
- forcetypeassert # finds forced type assertions [fast: true, auto-fix: false]
- funlen # Tool for detection of long functions [fast: true, auto-fix: false]
Expand All @@ -92,7 +91,6 @@ linters:
- godot # Check if comments end in a period [fast: true, auto-fix: true]
- godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
- err113 # Golang linter to check the errors handling expressions [fast: false, auto-fix: false]
- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
- lll # Reports long lines [fast: true, auto-fix: false]
- maintidx # maintidx measures the maintainability index of each function. [fast: true, auto-fix: false]
- nestif # Reports deeply nested if statements [fast: true, auto-fix: false]
Expand Down
2 changes: 1 addition & 1 deletion internal/services/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func ResourceContainerUpdate(ctx context.Context, d *schema.ResourceData, m inte
}

if d.HasChanges("max_concurrency") {
req.MaxConcurrency = scw.Uint32Ptr(uint32(d.Get("max_concurrency").(int)))
req.ScalingOption.ConcurrentRequestsThreshold = scw.Uint32Ptr(uint32(d.Get("max_concurrency").(int)))
}

if d.HasChanges("protocol") {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/container/helpers_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func setCreateContainerRequest(d *schema.ResourceData, region scw.Region) (*cont
}

if maxConcurrency, ok := d.GetOk("max_concurrency"); ok {
req.MaxConcurrency = scw.Uint32Ptr(uint32(maxConcurrency.(int)))
req.ScalingOption.ConcurrentRequestsThreshold = scw.Uint32Ptr(uint32(maxConcurrency.(int)))
}

if sandbox, ok := d.GetOk("sandbox"); ok {
Expand Down

0 comments on commit d156e34

Please sign in to comment.