I got problem with my api FastAPI, I got a big request that return me 700k rows. This request take 50 sec to be treat. But, the return response take 2mins and completely block the server who can't handle other request during those 2 mins.
And I don't Know how to handle this ... Here is my code :
@app.get("/request")
async def request_db(data):
dict_of_result = await run_in_threadpool(get_data_from_pgsql, data)
# After 50 sec the code above is done with even others requests coming working
# But this return below block the server for 2min !
return dict_of_result
I can't add limit or pagination system that request is for specefic purpose. Thank you for help