all repos — honk @ 813c3cddc806197336b16e3b93a382dc82accb6a

my fork of honk

make sure we don't zap our own files
Ted Unangst tedu@tedunangst.com
Sat, 25 May 2019 14:44:40 -0400
commit

813c3cddc806197336b16e3b93a382dc82accb6a

parent

3d4e359fcf2735ea6bedcfbe51dd480fed3c53a0

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M honk.gohonk.go

@@ -1316,7 +1316,7 @@ doordie(db, "delete from honks where userid = ? and convoy = ?", userid, t)

} } expdate := time.Now().UTC().Add(-30 * 24 * time.Hour).Format(dbtimeformat) - doordie(db, "update files set content = '', local = 0 where length(content) > 20000 and fileid in (select fileid from donks join honks on donks.honkid = honks.honkid where honks.dt < ? and whofore = 0)", expdate) + doordie(db, "update files set content = '', local = 0 where length(content) > 20000 and fileid in (select fileid from donks join honks on donks.honkid = honks.honkid where honks.dt < ? and whofore = 0) and fileid not in (select fileid from donks join honks on donks.honkid = honks.honkid where whofore = 2)", expdate) doordie(db, "delete from files where fileid not in (select fileid from donks)") }