fix: bump history limits to 100k so all-time shows full dataset

This commit is contained in:
2026-08-09 17:41:14 +07:00
parent bbbf548d66
commit 9f26b32c86
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ class PostgresHistory:
end: datetime.datetime,
limit: int = 2000,
) -> List[Dict]:
if not 1 <= limit <= 10000:
raise ValueError("limit must be between 1 and 10000")
if not 1 <= limit <= 100000:
raise ValueError("limit must be between 1 and 100000")
if start >= end:
raise ValueError("start must be before end")
+1 -1
View File
@@ -452,7 +452,7 @@ async def get_thaiwater_sensors():
async def get_postgres_history(
station_code: str,
hours: int = Query(168, ge=1),
limit: int = Query(2000, ge=1, le=10000),
limit: int = Query(50000, ge=1, le=100000),
):
"""Get historical measurements for a station from PostgreSQL."""
cache_key = f"{station_code}:{hours}:{limit}"