diff --git a/CHANGELOG.md b/CHANGELOG.md index 50cc9b5..8377f16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to ### Added - `DomainChanges.tls` -- Rate limiting (default 10/s), configurable with `RATE_LIMIT` env variable (async only) +- Rate limiting (default 9/s), configurable with `RATE_LIMIT` env variable (async only) ### Changed diff --git a/README.md b/README.md index 132aa91..2c77e09 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Crate documentation is available in [docsrs][docs-url]. Example usage is availab - `RESEND_BASE_URL` to override the default base address: `https://api.resend.com` (Optional). - `RATE_LIMIT` to set the maximum amount of requests you can send per second. By default, this is - 10 as that is what Resend defaults to. In reality, the time window is set to 1.1s to avoid + 9 (Resend defaults to 10). In reality, the time window is set to 1.1s to avoid failures. This is thread-safe (as long as you use the same `Resend` client across threads!) >
WARNING: Rate limiting only works when using the async version (default) of the crate
diff --git a/src/config.rs b/src/config.rs index be36d9a..9d2f8b2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -41,7 +41,7 @@ impl Config { // ==== Rate limiting is a non-blocking thing only ==== #[cfg(not(feature = "blocking"))] let rate_limit_per_sec = env::var("RATE_LIMIT") - .unwrap_or_else(|_| "10".to_owned()) + .unwrap_or_else(|_| "9".to_owned()) .parse::() .expect("env variable `RATE_LIMIT` should be a valid u32");