Skip to content

Commit 324c2f8

Browse files
Set a longer API request timeout for the control VM in the NCP VPC
2 parents ea36873 + 5d83bbf commit 324c2f8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/core/infra/control.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/cloud-barista/cb-tumblebug/src/core/common"
2828
clientManager "github.com/cloud-barista/cb-tumblebug/src/core/common/client"
2929
"github.com/cloud-barista/cb-tumblebug/src/core/model"
30+
"github.com/cloud-barista/cb-tumblebug/src/core/model/csp"
3031
"github.com/cloud-barista/cb-tumblebug/src/core/resource"
3132
"github.com/cloud-barista/cb-tumblebug/src/kvstore/kvstore"
3233
"github.com/go-resty/resty/v2"
@@ -437,6 +438,12 @@ func ControlVmAsync(wg *sync.WaitGroup, nsId string, mciId string, vmId string,
437438
client := resty.New()
438439
client.SetTimeout(10 * time.Minute)
439440

441+
// Set longer timeout for NCP (VPC)
442+
if strings.Contains(strings.ToLower(temp.ConnectionConfig.ProviderName), csp.NCP) {
443+
log.Debug().Msgf("Setting longer API request timeout (15m) for %s", csp.NCP)
444+
client.SetTimeout(15 * time.Minute)
445+
}
446+
440447
requestBody := model.SpiderConnectionName{}
441448
requestBody.ConnectionName = temp.ConnectionName
442449

0 commit comments

Comments
 (0)