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

Job reporting fixes #107

Closed
wants to merge 4 commits into from
Closed

Job reporting fixes #107

wants to merge 4 commits into from

Conversation

Zharktas
Copy link
Member

Job reporting has some inconsistencies which causes confusing behavior.

If harvest job is executed and there are zero new revision, the harvest job never receives job finished timestamp.

If harvest job is executed again, it refresher all harvested datasets, but since it creates new HarvestObjects, they don't have report_status saved and the job report shows that all datasets are deleted although nothing actually changed.

@@ -178,6 +178,8 @@ def _create_or_update_package(self, package_dict, harvest_object):

else:
log.info('Package with GUID %s not updated, skipping...' % harvest_object.guid)
harvest_object.report_status = 'not modified'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd much rather report_status was only updated in queue.py, rather than introduce a new place where it potentially gets updated. Also, this is a deprecated method to be updating.

My preference would be for fetch_stage() to return True, False or "unchanged" to queue.py and set report_status there.

@Zharktas
Copy link
Member Author

I modified it based on your comments, now import stage returns "unchanged" if it the dataset is unchanged and queue.py set report_status based on this.

@davidread davidread self-assigned this Sep 10, 2015
davidread pushed a commit that referenced this pull request Nov 3, 2015
* fix "existing_package_dict" which wasn't containing metadata_modified (because of the schema in the context) so you never skipped an object.
* fix IntegrityError due to resource revision_id being harvested. No idea why this hasn't caused errors before now.
* "unchanged" is now checked in base instead of ckanharvester - makes sense. Looking at other harvesters, it's normal to return from the import_stage with the value returned from base._create_or_update_package so I've continued with that.
* "unchanged" response is now documented
* better report_status tests in test_queue2.
@davidread
Copy link
Contributor

I've taken these changes, added some tests and related fixes and created PR #177 as a replacement for this one.

@davidread davidread closed this Nov 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants