neutral-face-emoji-tools
neutral-face-emoji-tools copied to clipboard
Rate limiting
Bulk uploading emoji is not being rate limited. The rate limiter returns a time frame to try again, so it should be pretty easy to handle the message and pause uploads. Would also be a nice to have to show a countdown until it resumes.
@casmbu do you know what the rate is, is it an error message showing up next to the emoji when this happens? I know Chrome can only handle so many connections at a time as well. How many emojis were you trying to upload when this happens? If you have an exact error message it could help handle this.
Rate limit information is here: https://api.slack.com/docs/rate-limits
The headers described there are what I was seeing. I was uploading a couple thousand emoji.
I imagine it's a webapi tier 3. Thanks for that link @casmbu ! edit: although emoji listing is rated at T2, but then it mentions that pagination type requests are often going to be T3 🤔
I mean it could be possible to detect the error, throttle down, and requeue the emoji as another option.
I went the quick-and-dirty route of simply telling SuperAgentThrottle to limit requests to 15/minute. Slack's API docs state that the web API (T2) is limited to 20+ per minute, but when attempting 20 requests per minute I was still getting my requests denied. Setting the limit to 15 per minute did the trick and I was able to upload over 4,000 custom emoji in a single drag/drop.
See PR #15 for implementation.
Would love to see that PR merged. Uploading large sets is a bit painful right now 😅
My fork retries when failures happen, and recognizes "name taken" errors: https://github.com/adamdicarlo/slack-emoji-tools/tree/fix-uploading
it's not in shape to be PRable here, and is a few months behind this repo.
I got tired of the chasm of expression between a couple of my Slack workspaces so tried my hand at a fix for this ☝️ I gave it a set of 4500 emojis and it handled it well!
Thanks for the great tool! 🙇