()
| 143 | } |
| 144 | |
| 145 | func shouldUsePremium() bool { |
| 146 | info := GetGlobalRateLimit() |
| 147 | if info == nil || info.Unknown { |
| 148 | return true |
| 149 | } |
| 150 | if info.PReq > 0 { |
| 151 | return true |
| 152 | } |
| 153 | nowEpoch := time.Now().Unix() |
| 154 | if nowEpoch >= info.ResetEpoch { |
| 155 | return true |
| 156 | } |
| 157 | return false |
| 158 | } |
| 159 | |
| 160 | func updateRateLimit(info *uctypes.RateLimitInfo) { |
| 161 | if info == nil { |
no test coverage detected