@@ 1194,7 1194,7 @@ func prepareStatements(db *sql.DB) {
stmtGetXonker = preparetodie(db, "select info from xonkers where name = ? and flavor = ?")
stmtSaveXonker = preparetodie(db, "insert into xonkers (name, info, flavor, dt) values (?, ?, ?, ?)")
stmtDeleteXonker = preparetodie(db, "delete from xonkers where name = ? and flavor = ? and dt < ?")
- stmtDeleteOldXonkers = preparetodie(db, "delete from xonkers where dt < ?")
+ stmtDeleteOldXonkers = preparetodie(db, "delete from xonkers where dt < ? and flavor <> 'handle'")
stmtRecentHonkers = preparetodie(db, "select distinct(honker) from honks where userid = ? and honker not in (select xid from honkers where userid = ? and flavor = 'sub') order by honkid desc limit 100")
stmtUpdateFlags = preparetodie(db, "update honks set flags = flags | ? where honkid = ?")
stmtClearFlags = preparetodie(db, "update honks set flags = flags & ~ ? where honkid = ?")
@@ 2962,13 2962,13 @@ func enditall() {
func bgmonitor() {
for {
+ time.Sleep(150 * time.Minute)
when := time.Now().Add(-2 * 24 * time.Hour).UTC().Format(dbtimeformat)
_, err := stmtDeleteOldXonkers.Exec(when)
if err != nil {
elog.Printf("error deleting old xonkers: %s", err)
}
xonkInvalidator.Flush()
- time.Sleep(150 * time.Minute)
}
}