refactor: single remove

This commit is contained in:
Barış Soner Uşaklı
2025-02-14 10:41:52 -05:00
parent d872470843
commit 77dd6dd0e7

View File

@@ -39,9 +39,7 @@ Analytics.init = async function () {
if (runJobs) { if (runJobs) {
new cronJob('*/30 * * * *', (async () => { new cronJob('*/30 * * * *', (async () => {
const cutoff = Date.now() - 172800000; await db.sortedSetsRemoveRangeByScore(['ip:recent'], '-inf', Date.now() - 172800000);
const ips = await db.getSortedSetRangeByScore('ip:recent', 0, 500, '-inf', cutoff);
await db.sortedSetRemove('ip:recent', ips);
}), null, true); }), null, true);
} }