Is there a way to provide a 30 second limit on the local devengine server?

Hey, I was wondering if there is a way to provide a 30 second limit that runs online on application production servers on a local dev server? it cannot be verified if I have reached the limit before the start of production.

maybe some django middlware?

+3
source share
2 answers

You can write (and push the WSGI stack) a useful piece of WSGI middleware that uses threading.Timer , which logs the fact that the transaction has exceeded 30 seconds (and, of course, calls cancel on the exit timer object, since this do not write anything).

I would do it at the WSGI level and not at the Django level, (a) because I am more familiar with the WSGI middleware and (b) because it is a more general solution (it can help the Django web application, but it can also help the web application using any other infrastructure - the use of WSGI is guaranteed by App Engine, no matter what structure you plan to assign to it).

"30 " , , , , , .. Google, (, ) " SDK" " Google" (, , !).

, , - , ( 30 ) (, 15 20 ), , /

+1

, , : , , -, , , .

, , , , 30- .

+1

Source: https://habr.com/ru/post/1749774/


All Articles