File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,18 @@ Pages:
160160 dataNode , ok := rootNode ["data" ].(map [string ]interface {})
161161 if ! ok {
162162 retryCount ++
163- if retryCount < maxRetryCount {
163+ errorMsg := strPropOrEmpty (rootNode , "message" )
164+ if errorMsg != "" {
165+ log .Printf ("Error accessing data element. Message: %s" , errorMsg )
166+ } else {
164167 log .Println ("Error accessing data element" )
165- time .Sleep (10 * time .Second )
168+ }
169+ if retryCount < maxRetryCount {
170+ waitDuration := 10 * time .Second
171+ if strings .Contains (strings .ToLower (errorMsg ), "secondary rate limit" ) {
172+ waitDuration = 65 * time .Second
173+ }
174+ time .Sleep (waitDuration )
166175 continue Pages
167176 } else {
168177 log .Fatalln ("Too many errors received. Quitting." )
You can’t perform that action at this time.
0 commit comments