Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added config option for setting timeout of ncss-related requests #316

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arpav_ppcv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions arpav_ppcv/webapp/api_v2/routers/coverages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down