Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uWSGI - Different Harakiri Timeout for Django Admin

Is it possible to set uWSGI's harakiri timeout to be different for Django admin pages?

I have a site which requires large files to be uploaded, which can take more than 20 or 30 seconds, but I want the global harakiri timeout to be more like 15s because of how I'm sending data back to the user.

Is this supported by uWSGI? Is there any way I can indidate this from within my Django project?

like image 485
Jamie Counsell Avatar asked Jan 03 '15 20:01

Jamie Counsell


1 Answers

Be sure your instance has internal routing enabled (a pretty scary warning is printed on startup logs if you do not have it) and delegates harakiri management to it (so remove the harakiri options):

[uwsgi]
; set harakiri to 30 seconds for /admin
route = ^/admin harakiri:30
; stop the routing chain for /admin
route = ^/admin last:
; set harakiri to 15 for all the other uris
route-run = harakiri:15
like image 122
roberto Avatar answered Sep 25 '22 00:09

roberto