MinnDevelopment/discord-webhooks

CloudFlare Ratelimits

Shea4 opened this issue · 4 comments

Shea4 commented

I was just wondering if you handle cloudflare bans, because yesterday I hit a cloudflare ban and it seemed the library kept accumulating requests and continuosly tried to send them instead of falling back and waiting for the ban to end which meant I was just guaranteed to get banned for the next hour especially with the amount of requests it was accumulating. So not sure if this is due to the library not handling cloudflare ratelimits or if it has something to do with something else.
image

Yes, cloudflare rate limits are handled just like discord rate limits are. There is a Retry-After header which is handled by each WebhookClient here.

Shea4 commented

Thanks for the clarification, do you have any idea on why it may not have fallen back in my case then?

You either used an outdated version of the library, or you used multiple webhook clients that don't share rate limit information and all hit the same rate limit.

Shea4 commented

I see, I'll have a look into that thanks for the help