Skip to content

Commit

Permalink
fix: 429 retry_after is in seconds, not milliseconds (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadleb committed Jan 6, 2022
1 parent d238f6f commit f9a94c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/discordrb/api.rb
Expand Up @@ -143,7 +143,7 @@ def request(key, major_parameter, type, *attributes)

unless mutex.locked?
response = JSON.parse(e.response)
wait_seconds = response['retry_after'].to_i / 1000.0
wait_seconds = response['retry_after'].to_f
Discordrb::LOGGER.ratelimit("Locking RL mutex (key: #{key}) for #{wait_seconds} seconds due to Discord rate limiting")
trace("429 #{key.join(' ')}")

Expand Down

0 comments on commit f9a94c9

Please sign in to comment.