File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import (
1717 "fmt"
1818 "os"
1919 "strings"
20+ "time"
2021
2122 "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
2223 "github.com/aliyun/aliyun-cli/cli"
@@ -100,8 +101,18 @@ func (a *RpcInvoker) Prepare(ctx *cli.Context) error {
100101}
101102
102103func (a * RpcInvoker ) Call () (* responses.CommonResponse , error ) {
103- resp , err := a .client .ProcessCommonRequest (a .request )
104- // cli.Printf("Resp: %s", resp.String())
104+ var resp * responses.CommonResponse
105+ var err error
106+
107+ for i := 0 ; i < 5 ; i ++ {
108+ resp , err = a .client .ProcessCommonRequest (a .request )
109+ if err != nil && strings .Contains (err .Error (), "Throttling.User" ) {
110+ time .Sleep (time .Duration (i + 1 ) * time .Second )
111+ continue
112+ }
113+ break
114+ }
115+
105116 return resp , err
106117}
107118
You can’t perform that action at this time.
0 commit comments