Skip to content

Commit

Permalink
docs: correct title of job_set_resource_metadata_base
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 26, 2024
1 parent 375d319 commit 678a9ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.21.1
- docs: correct title of job_set_resource_metadata_base
0.21.0
- ref: migrate to dcor_shared.RQJob for background jobs
- enh: introduce "is_background_job" context
Expand Down
9 changes: 8 additions & 1 deletion ckanext/dcor_schemas/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,20 @@ def patch_resource_noauth(package_id, resource_id, data_dict):
@rqjob_register(ckanext="dcor_schemas",
queue="dcor-short")
def job_set_resource_metadata_base(resource):
"""Workaround for not circular code
"""Set basic resource metadata
`package_revise` calls `after_dataset_update` which calls
`after_resource_create` in the dcor_schemas plugin. But in
`after_resource_create`, we only run jobs that have not been
run before. So it makes sense to perform any additional calls
to `package_revise` in those background jobs.
Notes
-----
This method exists as a workaround to avoid circular code. When this
method calls `patch_resource_noauth`, it does so with the
`admin_background_context`, preventing any other background jobs from
being triggered.
"""
res_dict_base = get_base_metadata(resource)
patch_resource_noauth(
Expand Down

0 comments on commit 678a9ba

Please sign in to comment.