mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: single remove
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user