Skip to content

Commit

Permalink
set timeout for ecs ram role
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Aug 13, 2024
1 parent c2314f2 commit a97e863
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdk/auth/credentials/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,9 @@ func (provider *ECSRAMRoleCredentialsProvider) getRoleName() (roleName string, e
err = fmt.Errorf("get role name failed: %s", err.Error())
return
}
httpClient := &http.Client{}
httpClient := &http.Client{
Timeout: 5 * time.Second,
}
httpResponse, err := hookDo(httpClient.Do)(httpRequest)
if err != nil {
err = fmt.Errorf("get role name failed: %s", err.Error())
Expand Down Expand Up @@ -551,7 +553,9 @@ func (provider *ECSRAMRoleCredentialsProvider) getCredentials() (sessionCredenti
err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error())
return
}
httpClient := &http.Client{}
httpClient := &http.Client{
Timeout: 5 * time.Second,
}
httpResponse, err := hookDo(httpClient.Do)(httpRequest)
if err != nil {
err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error())
Expand Down

0 comments on commit a97e863

Please sign in to comment.