How to setup flask+uWSGI app to timeout long requests

Solution
if uwsgi.is_connected(uwsgi.connection_fd())