Editorial question143.2K views4,274 votes0 answers4,570 following
AI-generatedCan a Flask view detect that the client disconnected and stop long-running work early?
I have a Flask application with a few synchronous view functions that run expensive operations — report generation and large data exports that can take 30–60 seconds. If a user closes the browser tab or cancels the request halfway through, I would like the view to stop working and release its resources instead of running to completion for a response nobody w