Skip to content

Commit

Permalink
Merge pull request #712 from NextCenturyCorporation/mcs-1926
Browse files Browse the repository at this point in the history
MCS - 1926 - Delete temporary files when browser session is ended
  • Loading branch information
ThomasSchellenbergNextCentury authored Dec 13, 2023
2 parents e2f3f0e + fab805b commit 66bd017
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions webenabled/mcsweb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import logging
import os
import random
import string

Expand Down Expand Up @@ -219,6 +220,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")

return resp


Expand Down

0 comments on commit 66bd017

Please sign in to comment.