Add Request Timeout on API level

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Add Request Timeout on API level

Pankhuri Agarwal
I would like to know if there is any django rest native method to add request timeouts at API level.

Any api having request timeout set to x ms should return response {'status_code': 408, 'message': 'Request Timeout'} after x ms if no other response is returned till that time.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3deae2cf-c2db-45c0-a12c-c5bae84e0c5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Request Timeout on API level

Adam Johnson-2
There isn't a native request timeout in Django, however you can configure your hosting WSGI server (at least gunicorn and uWSGI) to have a request timeout, and indeed it's recommended. I'm not sure how hard it would be to implement this (reliably, for all cases and platforms) inside Django.

On 26 December 2017 at 10:54, Pankhuri Agarwal <[hidden email]> wrote:
I would like to know if there is any django rest native method to add request timeouts at API level.

Any api having request timeout set to x ms should return response {'status_code': 408, 'message': 'Request Timeout'} after x ms if no other response is returned till that time.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3deae2cf-c2db-45c0-a12c-c5bae84e0c5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM0L6%2Bkb0WanHOZ96YiYPJTKh4uSGVxR_Fh5Xd5JBX%3Dw3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.