fix: bump history limits to 100k so all-time shows full dataset
This commit is contained in:
@@ -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
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user