Skip to content
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

How to increase timeout on specific method? #1824

Closed
ali-hallaji opened this issue Mar 29, 2020 · 6 comments · Fixed by #1876
Closed

How to increase timeout on specific method? #1824

ali-hallaji opened this issue Mar 29, 2020 · 6 comments · Fixed by #1876

Comments

@ali-hallaji
Copy link

Is there any option to increase timeout and request size on the top of method such as decorators?
Sometimes we need to increase our time of request such as uploading files.
Also, I asked a question on Stackoverflow about this issue.

@Tronic
Copy link
Member

Tronic commented Mar 29, 2020

An experimental branch PR #1791 already allows adjusting request max size in handlers and I could implement timeout adjustments on that as well. You can test the streaming branch by:

pip install git+https://github.com/Tronic/sanic@streaming

These features are expected to be available in Sanic 20.6 or later, once the streaming branch gets merged, because without that it is difficult to implement such adjustments on per-route basis.

@ali-hallaji
Copy link
Author

Thank you so much @Tronic
But Is it a stable and reliable version? Because I need to use it from the community version(continuously updated by the community).
Also, I need to use such an option variable to set value for that on the top of the function.

@Tronic
Copy link
Member

Tronic commented Mar 29, 2020

It works reliably but APIs are not finalised, so I would not recommend using it in any serious production setups at this time. By testing now you can affect how it is going to look, but otherwise you should wait until July or October for the first stable release.

Within this branch, if your route has stream=True, large uploads should work without adjusting the limits manually. Streaming handlers get infinite request maximum size by default and the request timeout gets reset every time that any data is received from client.

@stale
Copy link

stale bot commented Jun 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.

@stale stale bot added the stale label Jun 27, 2020
@Tronic
Copy link
Member

Tronic commented Jun 27, 2020

This still needs to be sorted out.

@stale stale bot removed the stale label Jun 27, 2020
@stale
Copy link

stale bot commented Sep 26, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.

@stale stale bot added the stale label Sep 26, 2020
@ahopkins ahopkins added necessary and removed stale labels Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants