Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix to retry_after being a float value
  • Loading branch information
Mysterypotatoguy authored and felldo committed Jun 24, 2021
1 parent 21f2522 commit 22b7d9b
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -182,8 +182,9 @@ private void handleResponse(

// Check if we received a 429 response
if (result.getResponse().code() == 429) {
int retryAfter =
result.getJsonBody().isNull() ? 0 : result.getJsonBody().get("retry_after").asInt();
long retryAfter =
result.getJsonBody().isNull()
? 0 : (long) (result.getJsonBody().get("retry_after").asDouble() * 1000);

if (global) {
// We hit a global ratelimit. Time to panic!
Expand Down

0 comments on commit 22b7d9b

Please sign in to comment.