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

Harvesters / GeoNetwork harvester / Re-add exiting files when re-harvesting #6416

Merged
merged 2 commits into from Jun 21, 2022

Conversation

juanluisrp
Copy link
Contributor

@juanluisrp juanluisrp commented Jun 20, 2022

getResourceDescription must return null if the resource doesn't exist. This way the caller Aligner process
can save the file again as it checks for null to know if the resource exists or not.

This was causing that in the first harvest run the file was created but in the following run it was deleted and not added again because the aligner thought the file still existed.

…esting

getResourceDescription must return null if the resource doesn't exist. This way the caller Aligner process
can save the file again as it checks for null to know if the resource exists or not.
@josegar74
Copy link
Member

The code changes are aligned with the other stores, that return null if there is an error in the method. For example:

try {
final CmisObject object = cmisConfiguration.getClient().getObjectByPath(key);
return createResourceDescription(context, metadataUuid, visibility, filename, (Document)object, metadataId, approved);
} catch (CmisObjectNotFoundException e) {
return null;
}

@sonarcloud
Copy link

sonarcloud bot commented Jun 20, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@juanluisrp juanluisrp merged commit c3fe382 into main Jun 21, 2022
juanluisrp added a commit that referenced this pull request Jun 21, 2022
…-harvesting (#6416)

* Harvesters / GeoNetwork harvester / Re-add exiting files when re-harvesting

getResourceDescription must return null if the resource doesn't exist. This way the caller Aligner process
can save the file again as it checks for null to know if the resource exists or not.

* Add test cases

Backport of #6416
@juanluisrp juanluisrp deleted the fixes/main/dont-remove-file-on-reharvest branch June 21, 2022 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants