Small tweak to message cleanup

This commit is contained in:
Dragory 2020-05-28 02:30:03 +03:00
parent e4aa101edd
commit 8f71e51041
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -32,6 +32,7 @@ async function cleanup() {
qb.andWhere(`posted_at <= (NOW() - INTERVAL ${RETENTION_PERIOD}000 MICROSECOND)`);
}),
)
.limit(100_000) // To avoid long table locks, delete max 100,000 rows at once
.delete()
.execute();