(session *Session, id int64)
| 135 | } |
| 136 | |
| 137 | func GetRepository(session *Session, id int64) *github.Repository { |
| 138 | client := session.GetClient() |
| 139 | repo, resp, _ := client.Repositories.GetByID(session.Context, id) |
| 140 | |
| 141 | if resp.Rate.Remaining <= 1 { |
| 142 | session.Log.Warn("Token %s rate limited. Reset at %s", client.Token, resp.Rate.Reset) |
| 143 | client.RateLimitedUntil = time.Until(resp.Rate.Reset.Time) |
| 144 | } |
| 145 | |
| 146 | return repo |
| 147 | } |
no test coverage detected