Skip to content

Commit

Permalink
update dynamicProxyEip.go sleep time
Browse files Browse the repository at this point in the history
  • Loading branch information
ss75710541 committed Nov 20, 2019
1 parent a4d90a3 commit 686f3cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dynamicProxyEip.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func unassociateEip(allocationId string, instanceId string, client *vpc.Client)
response, err := client.UnassociateEipAddress(request)

if err != nil {
if i < 4 {
if i < 10 {
i++
time.Sleep(1*time.Second)
continue
Expand All @@ -111,7 +111,7 @@ func associateEip(allocationId string, instanceId string, client *vpc.Client) er
for {
response, err := client.AssociateEipAddress(request)
if err != nil {
if i < 4 {
if i < 10 {
i++
time.Sleep(1*time.Second)
continue
Expand All @@ -137,13 +137,14 @@ func allocateNewEip(err error, client *vpc.Client) (string,string) {
allocationId := response.AllocationId
return eip,allocationId
}

// 释放Eip
func releaseEip(allocationId string, client *vpc.Client) {
request := vpc.CreateReleaseEipAddressRequest()
request.AllocationId = allocationId

var err error
for i:=0;i<5;i++ {
for i:=0;i<10;i++ {
var response *vpc.ReleaseEipAddressResponse
response, err = client.ReleaseEipAddress(request)

Expand Down

0 comments on commit 686f3cf

Please sign in to comment.