for now, no chats older than 3 days
Ted Unangst tedu@tedunangst.com
Sat, 23 May 2020 19:05:23 -0400
1 files changed,
3 insertions(+),
2 deletions(-)
jump to
M
database.go
→
database.go
@@ -539,7 +539,8 @@ return err
} func loadchatter(userid int64) map[string][]*Chonk { - rows, err := stmtLoadChonks.Query(userid) + duedt := time.Now().Add(-3 * 24 * time.Hour).UTC().Format(dbtimeformat) + rows, err := stmtLoadChonks.Query(userid, duedt) if err != nil { log.Printf("error loading chonks: %s", err) return nil@@ -899,5 +900,5 @@ stmtSaveFilter = preparetodie(db, "insert into hfcs (userid, json) values (?, ?)")
stmtDeleteFilter = preparetodie(db, "delete from hfcs where userid = ? and hfcsid = ?") stmtGetTracks = preparetodie(db, "select fetches from tracks where xid = ?") stmtSaveChonk = preparetodie(db, "insert into chonks (userid, xid, who, target, dt, noise, format) values (?, ?, ?, ?, ?, ?, ?)") - stmtLoadChonks = preparetodie(db, "select chonkid, userid, xid, who, target, dt, noise, format from chonks where userid = ?") + stmtLoadChonks = preparetodie(db, "select chonkid, userid, xid, who, target, dt, noise, format from chonks where userid = ? and dt > ? order by chonkid asc") }