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
Retry batch requests (fixes #39) #51
Conversation
leplatrem
commented
Feb 4, 2016
- Baby steps
- Read and wait value of retry header
- Choose location of code between batch client or client
- Refactor
payload={'requests': chunk} | ||
) | ||
args = ('POST', self.endpoints.get('batch')) | ||
kwargs = dict(payload={'requests': chunk}) |
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 would think it's fine to actually pass everything in the kwargs.
That's a good start :) |
8c402c1
to
9f95a33
Compare
@almet I wonder if that is the correct approach. Instead of this, restricted to the batch request, I would suggest to generalize it to every method. client = Client(..., retry=2, retry_after=20) or: client = Client()
client.create_bucket('fonts', retry=3) and obviously: client = Client(retry=10)
with client.batch('fonts', retry_after=0) as batch:
batch.create_record(..) And thus move the current to session instead |
I see little value to have this defined for all the methods of the client. Configuring the session to handle this seems however a better approach. |
Retry on error | ||
-------------- | ||
|
||
When the server is throttled, under heavy load, or maintenance, it can |
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.
consider When the server is throttled (under heavy load or maintenance), it can return error responses.
r+wc (needs to be rebased) |
auth=credentials, | ||
retry=10) | ||
|
||
the Kinto protocol lets the the server `define the duration in seconds between retries |
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.
typo: The (capital)
typo: double the the
Merge looks ok! r+ (with small typo) |
Retry batch requests (fixes #39)