I have the following setup on my flask heroku app to avoid timeout exception. Everything is working fine and I can pass the timeout exception.