Skip to content

Commit

Permalink
Add request timeout configs for listing user jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Sep 11, 2024
1 parent 5cf49ac commit 65816b4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is roughly based on [Keep a Changelog](https://keepachangelog.com/en/

<!-- start changelog -->

## 0.38.0

- Add request timeout configs for listing user jobs (eu-cdse/openeo-cdse-infra#188)

## 0.37.1

- Better error message when requested collections are spread across separate backends ([#153](https://github.com/Open-EO/openeo-aggregator/issues/153))
Expand Down
2 changes: 1 addition & 1 deletion src/openeo_aggregator/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from typing import Optional

__version__ = "0.37.1a1"
__version__ = "0.38.0a1"


def log_version_info(logger: Optional[logging.Logger] = None):
Expand Down
9 changes: 8 additions & 1 deletion src/openeo_aggregator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,15 @@ def get_user_jobs(self, user_id: str) -> Union[List[BatchJobMetadata], dict]:
all_jobs = []
federation_missing = set()

backend_config = get_backend_config()

results = self.backends.request_parallel(
path="/jobs", method="GET", expected_status=[200], authenticated_from_request=flask.request
path="/jobs",
method="GET",
expected_status=[200],
authenticated_from_request=flask.request,
request_timeout=backend_config.request_timeout_list_jobs,
overall_timeout=backend_config.request_timeout_list_jobs_overall,
)
for backend_id, result in results.successes.items():
try:
Expand Down
3 changes: 3 additions & 0 deletions src/openeo_aggregator/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ class AggregatorBackendConfig(OpenEoBackendConfig):

job_options_update: Optional[JobOptionsUpdater] = None

request_timeout_list_jobs: float = 10
request_timeout_list_jobs_overall: float = 20


# Internal singleton
_config_getter = ConfigGetter(expected_class=AggregatorBackendConfig)
Expand Down

0 comments on commit 65816b4

Please sign in to comment.