feat: remove activities older than a week

This commit is contained in:
Barış Soner Uşaklı
2025-02-18 12:06:02 -05:00
parent e308845049
commit d9e86c7b07

View File

@@ -63,6 +63,7 @@ ActivityPub.startJobs = () => {
new CronJob('0 0 * * *', async () => { new CronJob('0 0 * * *', async () => {
try { try {
await ActivityPub.notes.prune(); await ActivityPub.notes.prune();
await db.sortedSetsRemoveRangeByScore(['activities:datetime'], '-inf', Date.now() - 604800000);
} catch (err) { } catch (err) {
winston.error(err.stack); winston.error(err.stack);
} }