voice state - also there was no git history here so im just force pushing

This commit is contained in:
CEF Server 2024-05-11 07:40:39 +00:00
commit 9c41144985
9 changed files with 207 additions and 0 deletions

8
scripts/cleanup.py Normal file
View 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")