delete old muted threads from db

This commit is contained in:
Ted Unangst 2019-07-28 18:42:21 -04:00
parent 38b44ebef6
commit 686d139f54
1 changed files with 3 additions and 0 deletions

View File

@ -1528,6 +1528,9 @@ func cleanupdb(arg string) {
doordie(db, "delete from honks where dt < ? and whofore = 0 and convoy not in (select convoy from honks where whofore = 2 or whofore = 3)", expdate)
}
doordie(db, "delete from files where fileid not in (select fileid from donks)")
for _, u := range allusers() {
doordie(db, "delete from zonkers where userid = ? and wherefore = 'zonvoy' and zonkerid < (select zonkerid from zonkers where userid = ? and wherefore = 'zonvoy' order by zonkerid desc limit 1 offset 200)", u.UserID, u.UserID)
}
}
var stmtHonkers, stmtDubbers, stmtSaveHonker, stmtUpdateFlavor, stmtUpdateCombos *sql.Stmt