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

Handle daily rate limit error separately #26

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Conversation

mdumandag
Copy link
Collaborator

We raise 429 status code on two occasions:

  • When the burst rate limit is exceeded, if the user published too many messages in a short amount of time
  • When the daily max message limit is exceeded

We were assuming that when the 429 status code is received it was always the first case, but it is not.

This PR adds the logic to handle this. Since it is hard to test it against the production QStash instance we use in tests, I didn't write any; but manually verified that it works.

@mdumandag mdumandag requested a review from CahidArda July 10, 2024 06:45
We raise 429 status code on two occasions:

- When the burst rate limit is exceeded, if the user published
  too many messages in a short amount of time
- When the daily max message limit is exceeded

We were assuming that when the 429 status code is received it
was always the first case, but it is not.

This PR adds the logic to handle this. Since it is hard to test it
against the production QStash instance we use in tests, I didn't
write any; but manually verified that it works.
@mdumandag mdumandag force-pushed the daily-rate-limit-error branch from 242aa4f to 7c5351f Compare July 10, 2024 06:46
CahidArda added a commit to upstash/qstash-js that referenced this pull request Jul 10, 2024
Add QstashDailyRatelimitError on top of QstashChatRatelimitError and QstashRatelimitError to handle daily rate limit errors

equivalent of upstash/qstash-py#26
@CahidArda CahidArda merged commit bc329dd into main Jul 10, 2024
1 check passed
@CahidArda CahidArda deleted the daily-rate-limit-error branch July 10, 2024 08:06
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.

2 participants