-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat: set prefetch in client for traffic control #897
Conversation
Codecov Report
@@ Coverage Diff @@
## main #897 +/- ##
===========================================
- Coverage 82.70% 71.61% -11.10%
===========================================
Files 23 23
Lines 1567 1564 -3
===========================================
- Hits 1296 1120 -176
- Misses 271 444 +173
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Could you give an example of the new progress bar after this PR? |
@@ -334,6 +341,7 @@ def encode(self, content, **kwargs): | |||
on_error=on_error, | |||
on_always=partial(self._update_pbar, func=on_always), | |||
parameters=parameters, | |||
prefetch=prefetch, |
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.
You can just inline the code like: prefecth=kwargs.get('prefetch', 1000)
. You can reduce the number of lines if you do this to other params also.
@ZiniuYu From the example bar, I would suggest changing |
📝 Docs are deployed on https://ft-fix-client-prefetch--jina-docs.netlify.app 🎉 |
In this PR, we introduce the prefetch in client for traffic control.
This is especially beneficial to large and time consuming requests which can be unexpectedly be closed be remote server and cause timeout watchdog issue.
This PR also disables uploading progress bar that is not compatible with prefetching 🙁
For more info about client prefetching, please view https://docs.jina.ai/concepts/client/rate-limit/