Skip to content

Commit b793a6c

Browse files
committed
chore(config): increase default rate limit values
- Raise default RATE_LIMIT_READ_LIMIT from 500 to 1500 - Increase default RATE_LIMIT_WRITE_LIMIT from 50 to 150 - Update corresponding comments in .env.example file
1 parent b71dd1f commit b793a6c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
# RATE_LIMIT_REQUEST_CODE_WINDOW_HOURS=24
4949

5050
# OPTIONAL: Rate limit for general READ operations (e.g., GET /headlines).
51-
# RATE_LIMIT_READ_LIMIT=500
51+
# RATE_LIMIT_READ_LIMIT=1500
5252
# OPTIONAL: Window for READ operations, in minutes.
5353
# RATE_LIMIT_READ_WINDOW_MINUTES=60
5454

5555
# OPTIONAL: Rate limit for general WRITE operations (e.g., POST /headlines).
5656
# This is typically stricter than the read limit.
57-
# RATE_LIMIT_WRITE_LIMIT=50
57+
# RATE_LIMIT_WRITE_LIMIT=150
5858
# OPTIONAL: Window for WRITE operations, in minutes.
5959
# RATE_LIMIT_WRITE_WINDOW_MINUTES=60

lib/src/config/environment_config.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ abstract final class EnvironmentConfig {
159159

160160
/// Retrieves the request limit for READ operations.
161161
///
162-
/// Defaults to 5000 if not set or if parsing fails.
162+
/// Defaults to 1500 if not set or if parsing fails.
163163
static int get rateLimitReadLimit {
164-
return int.tryParse(_env['RATE_LIMIT_READ_LIMIT'] ?? '500') ?? 500;
164+
return int.tryParse(_env['RATE_LIMIT_READ_LIMIT'] ?? '1500') ?? 1500;
165165
}
166166

167167
/// Retrieves the time window for the READ operations rate limit.
@@ -175,9 +175,9 @@ abstract final class EnvironmentConfig {
175175

176176
/// Retrieves the request limit for WRITE operations.
177177
///
178-
/// Defaults to 500 if not set or if parsing fails.
178+
/// Defaults to 150 if not set or if parsing fails.
179179
static int get rateLimitWriteLimit {
180-
return int.tryParse(_env['RATE_LIMIT_WRITE_LIMIT'] ?? '50') ?? 50;
180+
return int.tryParse(_env['RATE_LIMIT_WRITE_LIMIT'] ?? '150') ?? 150;
181181
}
182182

183183
/// Retrieves the time window for the WRITE operations rate limit.

0 commit comments

Comments
 (0)