Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,18 @@ Pages:
dataNode, ok := rootNode["data"].(map[string]interface{})
if !ok {
retryCount++
if retryCount < maxRetryCount {
errorMsg := strPropOrEmpty(rootNode, "message")
if errorMsg != "" {
log.Printf("Error accessing data element. Message: %s", errorMsg)
} else {
log.Println("Error accessing data element")
time.Sleep(10 * time.Second)
}
if retryCount < maxRetryCount {
waitDuration := 10 * time.Second
if strings.Contains(strings.ToLower(errorMsg), "secondary rate limit") {
waitDuration = 65 * time.Second
}
time.Sleep(waitDuration)
continue Pages
} else {
log.Fatalln("Too many errors received. Quitting.")
Expand Down
Loading