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

Add a rate limits to the Google drive API and catch rate limit errors #25

Merged
merged 14 commits into from
Nov 5, 2024

Conversation

BenCookie95
Copy link
Contributor

Summary

  • Create a wrapper for all the Google API calls.
  • Added a rate limiter for the Google Drive API. The activity, sheets, docs and slides api do not have rate limiter because it's very unlikely they will cause an issue but I still catch any rate limit errors and block people for a period of time from making requests when they have exceeded any google rate limits.
  • Created a method in order to parse rate limit errors from Google.
  • Added 2 configs for configuring the rate limit, we cannot read the limits from Google using their API.
  • Moved some slash commands into command.go because the root server directory was cluttered with files containing 1 function.
  • Better use of context throughout.

TODO in another PR

  • Fix unbounded calls to the activity API

Copy link
Contributor

@fmartingr fmartingr 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 for the refactor and all the comments, makes it easier to follow around. 👍

@BenCookie95 BenCookie95 requested a review from wiggin77 November 5, 2024 15:54
Copy link
Collaborator

@wiggin77 wiggin77 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@BenCookie95 BenCookie95 merged commit 1e10074 into master Nov 5, 2024
4 checks passed
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.

3 participants