feat: keep notifs for one month, load 50 notifications instead of 30

This commit is contained in:
Barış Soner Uşaklı
2021-02-26 22:22:12 -05:00
parent 2674de01dd
commit 02f08111cf
2 changed files with 5 additions and 5 deletions

View File

@@ -318,8 +318,8 @@ Notifications.markAllRead = async function (uid) {
};
Notifications.prune = async function () {
const week = 604800000;
const cutoffTime = Date.now() - week;
const month = 2592000000;
const cutoffTime = Date.now() - month;
const nids = await db.getSortedSetRangeByScore('notifications', 0, 500, '-inf', cutoffTime);
if (!nids.length) {
return;