()
| 67 | } |
| 68 | |
| 69 | func (s *Session) GetClient() *GitHubClientWrapper { |
| 70 | sleepTime := 0 * time.Second |
| 71 | |
| 72 | for _, client := range s.Clients { |
| 73 | if client.RateLimitedUntil != 0 { |
| 74 | sleepTime = client.RateLimitedUntil |
| 75 | continue |
| 76 | } |
| 77 | |
| 78 | return client |
| 79 | } |
| 80 | |
| 81 | s.Log.Warn("All GitHub tokens exchausted/rate limited. Sleeping until %s", sleepTime) |
| 82 | time.Sleep(sleepTime) |
| 83 | |
| 84 | return s.GetClient() |
| 85 | } |
| 86 | |
| 87 | func (s *Session) InitThreads() { |
| 88 | if *s.Options.Threads == 0 { |
no test coverage detected