Fix MAdrid Open data file
This commit is contained in:
10
services/data/app/external/madrid_opendata.py
vendored
10
services/data/app/external/madrid_opendata.py
vendored
@@ -232,11 +232,10 @@ class MadridOpenDataClient(BaseAPIClient):
|
||||
return real_data
|
||||
else:
|
||||
logger.info("No real historical data available, using synthetic data")
|
||||
#return synthetic_data
|
||||
return synthetic_data
|
||||
except Exception as e:
|
||||
logger.warning("Failed to fetch real historical data, using synthetic", error=str(e))
|
||||
return synthetic_data
|
||||
|
||||
return synthetic_data
|
||||
except Exception as e:
|
||||
logger.error("Error getting historical traffic data", error=str(e))
|
||||
return []
|
||||
@@ -877,7 +876,8 @@ class MadridOpenDataClient(BaseAPIClient):
|
||||
'Accept-Language': 'es-ES,es;q=0.9,en;q=0.8',
|
||||
}
|
||||
|
||||
async with httpx.AsyncClient(timeout=120.0, headers=headers) as client:
|
||||
async with httpx.AsyncClient(timeout=120.0, headers=headers, follow_redirects=True) as client:
|
||||
|
||||
logger.debug("Fetching historical ZIP", url=url)
|
||||
response = await client.get(url)
|
||||
|
||||
@@ -907,7 +907,7 @@ class MadridOpenDataClient(BaseAPIClient):
|
||||
'Accept-Language': 'es-ES,es;q=0.9,en;q=0.8',
|
||||
}
|
||||
|
||||
async with httpx.AsyncClient(timeout=30.0, headers=headers) as client:
|
||||
async with httpx.AsyncClient(timeout=30.0, headers=headers, follow_redirects=True) as client:
|
||||
logger.debug("Fetching measurement points CSV", url=url)
|
||||
response = await client.get(url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user