This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Complement Step does not update all objects #39
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Inserting/ Updating new record to soup table should follow the steps below: 1. If object's UID exists in the table, just update the path if necessary. 2. If object's UID doesn't exist in the table, try to insert it. If insert fails, it is because of duplicate 'path'. Wait for duplicate record to be updated and then insert the Object.
xispa
suggested changes
Apr 10, 2018
src/senaite/sync/complementstep.py
Outdated
query["b_start"] = start_from | ||
items = self.get_items(**query) | ||
# Try one more time if items are not retrieved | ||
if not items: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to add two variables at the top of the class to make this more flexible. Sometimes, depending on the infrastructure, one might find useful to be able to set the maximum number of retries and the sleep time in seconds between 2 retries as well. I suggest to set the variables with the following values by default:
MAX_RETRIES=5
SLEEP_MS_RETRIES=5
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Current behavior
Expected Behavior after this PR
next
link won't be in the JSON response), we can retrieve objects fromuid_catalog
page by page with the window of 500.