fix: align web API limit cap with 10k and clean up postgres_history imports

This commit is contained in:
2026-08-09 17:36:58 +07:00
parent ef106fce8d
commit bbbf548d66
+1 -1
View File
@@ -452,7 +452,7 @@ async def get_thaiwater_sensors():
async def get_postgres_history( async def get_postgres_history(
station_code: str, station_code: str,
hours: int = Query(168, ge=1), hours: int = Query(168, ge=1),
limit: int = Query(2000, ge=1, le=5000), limit: int = Query(2000, ge=1, le=10000),
): ):
"""Get historical measurements for a station from PostgreSQL.""" """Get historical measurements for a station from PostgreSQL."""
cache_key = f"{station_code}:{hours}:{limit}" cache_key = f"{station_code}:{hours}:{limit}"