Skip to content

Commit

Permalink
fix: timeout after 500 s in dataset_activate
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 8, 2024
1 parent e4cbb4a commit b185d52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.15.3
- fix: timeout after 500 s in dataset_activate in case
the server is under heavy load
0.15.2
- setup: false dclab dependency version
0.15.1
Expand Down
8 changes: 6 additions & 2 deletions dcoraid/api/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .s3_api import upload_s3_presigned


def dataset_activate(dataset_id, api):
def dataset_activate(dataset_id: str, api: CKANAPI):
"""Change the state of a dataset to "active"
In the DCOR workflow, datasets are created as drafts and
Expand All @@ -34,7 +34,11 @@ def dataset_activate(dataset_id, api):
revise_dict = {
"match": {"id": dataset_id},
"update": {"state": "active"}}
api.post("package_revise", revise_dict)
api.post("package_revise",
revise_dict,
# Dataset activation may take long when there are a lot of
# resources.
timeout=500)


def dataset_create(dataset_dict, api, resources=None,
Expand Down

0 comments on commit b185d52

Please sign in to comment.