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 some better ratelimiting to email sending #526

Merged
merged 4 commits into from
Nov 18, 2022

Conversation

erikjohnston
Copy link
Member

No description provided.

@erikjohnston erikjohnston requested a review from a team as a code owner November 18, 2022 10:20
Copy link

@MatMaul MatMaul left a comment

Choose a reason for hiding this comment

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

Looks sane to me.

Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

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

The default rate limit looks good.

@erikjohnston erikjohnston merged commit 37bd539 into main Nov 18, 2022
@erikjohnston erikjohnston deleted the erikj/ratelimit_threepids branch November 18, 2022 12:51
Comment on lines +73 to +78
self.email_sender_ratelimit_burst = cfg.getint(
"email", "email.ratelimit_sender.burst", fallback=5
)
self.email_sender_ratelimit_rate_hz = cfg.getfloat(
"email", "email.ratelimit_sender.rate_hz", fallback=1.0 / (5 * 60.0)
)
Copy link

@MadLittleMods MadLittleMods Nov 18, 2022

Choose a reason for hiding this comment

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

To summarize the new rate limits,

  • Each sender can send up to 5 emails before the rate limit applies (burst)
  • After that, the sender can only send 1 email every 5 minutes (I like the way you defined it ⭐ 1.0 / (5 * 60.0))

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