voice state - also there was no git history here so im just force pushing
This commit is contained in:
commit
9c41144985
9 changed files with 207 additions and 0 deletions
8
scripts/cleanup.py
Normal file
8
scripts/cleanup.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from cef_3M import sql, minioClient
|
||||
|
||||
# This should be run every hour or so to clean up old uploads
|
||||
toDelete = sql.SqlExecuteFetchAll("SELECT *, NOW() FROM uploads WHERE expiry < NOW()")
|
||||
for f in toDelete:
|
||||
minioClient.remove_object("uploads", f["hash"])
|
||||
sql.SqlExecute("DELETE FROM `uploads` WHERE `hash` = %s", f["hash"])
|
||||
print(f"Deleted {len(toDelete)} old files")
|
||||
Loading…
Add table
Add a link
Reference in a new issue