-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Connection closed" Event listener #8094
Comments
Hi @mberco-quandl ! There already is such an event! It is the However, gradio can already clean up files periodically for you with the Will close this in the meantime. |
I love you guys for making life for frontend noobs a breeze. |
@freddyaboulton Without inputs to the unload event listener how does one control which files to delete upon terminating the session? |
@freddyaboulton for additional clarity I've tried referencing gr.File objects' path using the .value attribute without passing the gr.File in as an input, but it always returns a None. I've tried adding nonlocal flags, other solutions, nothing works as intended yet. Unsure how to a) access and b) pass the session-ID into the function triggered by .unload. Without b) I'm not sure how .unload can be used to manage storage. |
Is your feature request related to a problem? Please describe.
No clear way to handle storage leaks that arise when a file exists in Gradio temp storage and a user closes the connection. If running Gradio UI on a docker container disk storage is limited and introducing this leak can cause issues quickly.
Describe the solution you'd like
An event trigger for connection closed. This would allow the server to cleanup temp files associate with that specific connection that don't need to be preserved.
Additional context
Thank you!
The text was updated successfully, but these errors were encountered: