Skip to content

Commit

Permalink
add check for etag to prevent too many recursions
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 25, 2024
1 parent 0e1a71b commit 1922387
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ckanext/dcor_schemas/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ def package_types(self):
# IPackageController
def after_dataset_update(self, context, data_dict):
# TODO: Find a way to avoid using this constant.
# Trigger Background Jobs.
# `DISABLE_AFTER_DATASET_CREATE_FOR_CONCURRENT_JOB_TESTS` is used in
# concurrent job testing that do not involve `package_update` and
# `package_revise`.
Expand All @@ -367,7 +368,10 @@ def after_dataset_update(self, context, data_dict):
{'id': data_dict["id"]})

for resource in data_dict.get('resources', []):
if resource and "id" in resource:
# Do not perform any actions if the resource already
# contains the "etag", which means that all background
# jobs already ran.
if resource and "id" in resource and "etag" not in resource:
# Update with current
for res in ds_dict["resources"]:
if resource["id"] == res["id"]:
Expand Down

0 comments on commit 1922387

Please sign in to comment.