Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -41,8 +41,8 @@ def check_rate_limit(request: gr.Request):
|
|
41 |
# Check if rate limit exceeded
|
42 |
if len(request_times[ip]) >= MAX_REQUESTS:
|
43 |
time_remaining = int(TIME_WINDOW - (now - request_times[ip][0]))
|
44 |
-
time_remaining_minutes = time_remaining / 60
|
45 |
-
time_window_minutes = TIME_WINDOW / 60
|
46 |
return False, f"Rate limit exceeded. You can make {MAX_REQUESTS} requests per {time_window_minutes} minutes. Try again in {time_remaining_minutes} minutes."
|
47 |
|
48 |
|
|
|
41 |
# Check if rate limit exceeded
|
42 |
if len(request_times[ip]) >= MAX_REQUESTS:
|
43 |
time_remaining = int(TIME_WINDOW - (now - request_times[ip][0]))
|
44 |
+
time_remaining_minutes = round(time_remaining / 60, 1)
|
45 |
+
time_window_minutes = round(TIME_WINDOW / 60, 1)
|
46 |
return False, f"Rate limit exceeded. You can make {MAX_REQUESTS} requests per {time_window_minutes} minutes. Try again in {time_remaining_minutes} minutes."
|
47 |
|
48 |
|