Replies: 2 comments
-
fastAPI is not a workload management process. Also your question is already on stackoverflow -> https://stackoverflow.com/questions/68300429/fastapi-background-task-kill I think you can close this issue @lsmith77 , Thank you |
Beta Was this translation helpful? Give feedback.
0 replies
-
It seems my explanation was not clear. I am not looking for FastAPI to automatically end execution of the background task if the client cancels the request. I want the background task to run, but inside the background task I want to be able to log if the client actually read the response or not. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
I have an API that sends an API request for every key pressed in a client. Since its quite common that another key is pressed before the request returns, the client cancels these requests.
Is there some way I can detect if the request was canceled inside the background task?
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.68.2
Python Version
3.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions