fix bug where todo attempt was not updated after fetchWork #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
When worker calls fetchWork, the resources that have
TODO
relationships will be returned so the worker can execute the relevant extractors. As part of the fetchWork, theattempts
property of the TODO relationship is supposed to get updated. For a strange reason that I didn't fully understand, the query was not updating the TODO attempts. Therefore, everytime the worker is triggered, the task that has already been attempted is returned by the query meaning it's stuck in an infinite loop.The fix in this PR does the 2 followings:
Extraction_Failure
relationship between the relevant resource and the extractor, so that it is known to us that this extractor is not supported. This way the UI also shows that the extractor for the file failed.How to test
Tested locally