How can I handle request timeouts?
Hello, I am using Quart as a middleman between a Discord Client and another API, so basically Quart recieves POST request from Discord Client in the form of JSON, runs some functions and then sends data back to Discord Client. My problem is that after 60 seconds of inactivity Quart keeps throwing exceptions:
connectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host api. I am new to Python and Quart, and would appreciate it if anyone can help me solve this issue. Also, Quart opens a new connection right after sending answer to discord client, if there is a way to close the connection and await for a new post request I think that would solve the issue. Here is a snippet of my code:
from quart import Quart,request app = Quart(__name__) @app.route('/api' , methods=['POST']) async def test(): userinput=(await request.get_json())["userinput"] #do some other requests to another API return answer app.run()