Skip to content

Commit ed9911e

Browse files
committed
max_concurrent_requests
1 parent bd9f9d0 commit ed9911e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Diff for: civo/loadbalancer/resource_loadbalancer.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@ func resourceLoadBalancerCreate(ctx context.Context, d *schema.ResourceData, m i
275275
}
276276

277277
if v, ok := d.GetOk("max_concurrent_requests"); ok {
278-
num := v.(int)
279-
conf.MaxConcurrentRequests = &num
278+
conf.MaxConcurrentRequests = utils.IntPtr(v.(int))
280279
}
281280

282281
// Set backend configurations if provided
@@ -403,6 +402,10 @@ func resourceLoadBalancerUpdate(ctx context.Context, d *schema.ResourceData, m i
403402
updateRequest.SessionAffinityConfigTimeout = int32(d.Get("session_affinity_config_timeout").(int))
404403
}
405404

405+
if d.HasChange("max_concurrent_requests") {
406+
updateRequest.MaxConcurrentRequests = utils.IntPtr(d.Get("max_concurrent_requests").(int))
407+
}
408+
406409
if d.HasChange("enable_proxy_protocol") {
407410
updateRequest.EnableProxyProtocol = d.Get("enable_proxy_protocol").(string)
408411
}

Diff for: internal/utils/utils.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ func ValidateUUID(v interface{}, k string) (ws []string, errors []error) {
326326
return
327327
}
328328

329-
// CheckFileSize function checks if the file the file size is less than the allowed limit(current: 20MB)
329+
// CheckFileSize function checks if the file size is less than the allowed limit(current: 20MB)
330330
func CheckFileSize(path string) error {
331331
fileInfo, err := os.Stat(path)
332332
if err != nil {
@@ -340,3 +340,8 @@ func CheckFileSize(path string) error {
340340
}
341341
return nil
342342
}
343+
344+
// IntPtr returns a pointer to an int
345+
func IntPtr(i int) *int {
346+
return &i
347+
}

0 commit comments

Comments
 (0)