Skip to content
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

MCS - 1926 - Delete temporary files when browser session is ended #712

Merged
merged 5 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions webenabled/mcsweb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
import random
import string

Expand Down Expand Up @@ -217,6 +218,12 @@ def exit_unity():
)
resp.delete_cookie('uniq_id')

# delete static/mcsinterface/ folders
app.logger.info(f'{"Deleting static/mcsinterface/ folders"}')
os.system("find ./static/mcsinterface -name 'cmd_*' | xargs rm -r")
os.system("find ./static/mcsinterface -name 'output_*' | xargs rm -r")
os.system("find ./static/mcsinterface -name 'img_*' | xargs rm -r")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, I don't see any img_* files in my static/mcsinterface/ folder (is it an OS-specific thing?), but having it here doesn't hurt.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The img_* are folders that the rbg_* files that Rachel mentioned. Thats what they are for me.


return resp


Expand Down
Loading