twilight-rs / twilight

Powerful, flexible, and scalable ecosystem of Rust libraries for the Discord API.
https://discord.gg/twilight-rs
ISC License
689 stars 130 forks source link

gateway commands can hit websocket rate limit #193

Closed AEnterprise closed 4 years ago

AEnterprise commented 4 years ago

websocket has a rate limit of 120/60. If you send a lot of commands over a socket that get queued up (like say requesting member lists for 1400 guilds). The socket sometimes hits the rate limit and get killed by discord.

twilight re-opens it, resumes the session and every single pending command fails because it's internal receiver went away

zeylahellyer commented 4 years ago

This is due to using tokio's interval, for reasons similar to https://github.com/twilight-rs/twilight/pull/268