Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request caching + add ratelimit-over-408 + endpoint rewrite support #13

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

cheesycod
Copy link

@cheesycod cheesycod commented May 2, 2024

This PR adds support for (primitive) request caching for certain routes as well as the ability to 429 instead of 408 on a context deadline exceeded error. It also adds endpoint rewrite support which is useful in the instance where you may want to rewrite discord requests to other paths (for example, where the simple wsProxy string is not enough or if you have a seperate service for capturing state, an endpoint rewrite can be used to ensure all bots use it)

Copy link
Owner

@germanoeich germanoeich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the interest and contribution! I apologize for the delay reviewing this. There are some points of improvement but its all minor stuff, I like the changes and I think there is value in adding them to nirn :) Let me know if there are any questions about anything I've written here and let me know if these comments make sense to you aswell

Makefile Outdated Show resolved Hide resolved
lib/cache.go Outdated Show resolved Hide resolved
lib/discord.go Outdated Show resolved Hide resolved
lib/discord.go Outdated Show resolved Hide resolved
lib/discord.go Show resolved Hide resolved
lib/discord.go Outdated Show resolved Hide resolved
lib/discord.go Outdated Show resolved Hide resolved
lib/queue.go Outdated Show resolved Hide resolved
cheesycod and others added 5 commits June 25, 2024 18:43
Apply suffix change

Co-authored-by: Germano Eichenberg <[email protected]>
Co-authored-by: Germano Eichenberg <[email protected]>
This also includes endpoint rewrites which is useful for the use case of custom gateway endpoints
@cheesycod cheesycod changed the title Request caching + add ratelimit-over-408 support Request caching + add ratelimit-over-408 + endpoint rewrite support Jun 25, 2024
@cheesycod
Copy link
Author

@germanoeich Tried resolving the changes

lib/discord.go Outdated Show resolved Hide resolved
lib/discord.go Outdated Show resolved Hide resolved
cheesycod and others added 2 commits June 29, 2024 10:11
Co-authored-by: Germano Eichenberg <[email protected]>
Co-authored-by: Germano Eichenberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants