refactor: single remove

This commit is contained in:
Barış Soner Uşaklı
2025-02-14 10:41:52 -05:00
parent 48ec32b9c4
commit 0784e11b9b

View File

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