preserve threads we've participated in

This commit is contained in:
Ted Unangst 2019-06-02 20:52:16 -04:00
parent 2769d59e91
commit c6cef9e79e
1 changed files with 2 additions and 2 deletions

View File

@ -1342,8 +1342,8 @@ func cleanupdb() {
} }
} }
expdate := time.Now().UTC().Add(-30 * 24 * time.Hour).Format(dbtimeformat) expdate := time.Now().UTC().Add(-30 * 24 * time.Hour).Format(dbtimeformat)
doordie(db, "delete from donks where honkid in (select honkid from honks where dt < ? and whofore = 0)", expdate) doordie(db, "delete from donks where honkid in (select honkid 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 honks where dt < ? and whofore = 0", expdate) 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)") doordie(db, "delete from files where fileid not in (select fileid from donks)")
} }