-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure read timeout based on
wait
parameter (#373)
This fixes a bug in the new `wait` implementation where the default read timeout for the HTTP client is shorter than the timeout on the server. This results in the client erroring before the server has had the opportunity to respond with a partial prediction. This commit now provides a custom timeout for the `predictions.create` request based on the `wait` parameter provided. We add a 500ms buffer to the timeout to account for some discrepancy between server and client timings. I attempted to try and refactor the shared code between models, deployments & predictions but gave up. We now have a single function that creates the `headers` and `timeout` params and passes them in at the various call sites.
- Loading branch information
Showing
3 changed files
with
86 additions
and
65 deletions.
There are no files selected for viewing
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
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
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