Spaces:
Sleeping
Sleeping
Nicolas Wagner commited on
Commit ·
e3f4399
1
Parent(s): 113cb79
stop submissions
Browse files
src/submission/submit_csv.py
CHANGED
|
@@ -107,13 +107,14 @@ def check_rate_limit(team_name: str) -> tuple[bool, str]:
|
|
| 107 |
now = datetime.now(timezone.utc)
|
| 108 |
time_diff = now - last_time
|
| 109 |
|
| 110 |
-
if time_diff < timedelta(
|
| 111 |
-
remaining_seconds = (timedelta(
|
| 112 |
-
|
|
|
|
| 113 |
remaining_secs = int(remaining_seconds % 60)
|
| 114 |
return (
|
| 115 |
False,
|
| 116 |
-
f"Rate limit exceeded. Please wait {remaining_minutes} minutes and {remaining_secs} seconds before submitting again.",
|
| 117 |
)
|
| 118 |
|
| 119 |
return True, ""
|
|
|
|
| 107 |
now = datetime.now(timezone.utc)
|
| 108 |
time_diff = now - last_time
|
| 109 |
|
| 110 |
+
if time_diff < timedelta(hours=6):
|
| 111 |
+
remaining_seconds = (timedelta(hours=6) - time_diff).total_seconds()
|
| 112 |
+
remaining_hours = int(remaining_seconds // 3600)
|
| 113 |
+
remaining_minutes = int((remaining_seconds % 3600) // 60)
|
| 114 |
remaining_secs = int(remaining_seconds % 60)
|
| 115 |
return (
|
| 116 |
False,
|
| 117 |
+
f"Rate limit exceeded. Please wait {remaining_hours} hours, {remaining_minutes} minutes and {remaining_secs} seconds before submitting again.",
|
| 118 |
)
|
| 119 |
|
| 120 |
return True, ""
|