diff --git a/arpav_ppcv/config.py b/arpav_ppcv/config.py index 6997bfdb..6a169756 100644 --- a/arpav_ppcv/config.py +++ b/arpav_ppcv/config.py @@ -47,6 +47,7 @@ class ThreddsServerSettings(pydantic.BaseModel): base_url: str = "http://localhost:8080/thredds" wms_service_url_fragment: str = "wms" netcdf_subset_service_url_fragment: str = "ncss/grid" # noqa + netcdf_subset_service_timeout_seconds: int = 30 # noqa opendap_service_url_fragment: str = "dodsC" # noqa uncertainty_visualization_scale_range: tuple[float, float] = pydantic.Field( default=(0, 9) diff --git a/arpav_ppcv/webapp/api_v2/routers/coverages.py b/arpav_ppcv/webapp/api_v2/routers/coverages.py index 673e71b2..cce31dc5 100644 --- a/arpav_ppcv/webapp/api_v2/routers/coverages.py +++ b/arpav_ppcv/webapp/api_v2/routers/coverages.py @@ -452,6 +452,9 @@ async def get_forecast_data( fitted_bbox = None cache_key = datadownloads.get_cache_key(coverage, fitted_bbox, temporal_range) + http_client.timeout = ( + settings.thredds_server.netcdf_subset_service_timeout_seconds + ) response_to_stream = await datadownloads.retrieve_coverage_data( settings, http_client, cache_key, coverage, fitted_bbox, temporal_range )