perf: throttle trusted mute pruning

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-21 13:12:30 +00:00
1 parent d569e1474e
commit f7ebad4b2f
6 files changed
+9451

No files matched your search

+5
View File
@@ -893,6 +893,11 @@ export class ModerationService {
if (!aggregate || !(aggregate.muters instanceof Map)) {
continue;
}
// Throttle pruning: only run once per minute per author
if (aggregate.lastPrunedAt && nowSeconds - aggregate.lastPrunedAt < 60) continue;
aggregate.lastPrunedAt = nowSeconds;
const expiredOwners = new Set();
for (const [owner, updatedAt] of aggregate.muters.entries()) {
if (ensureNumber(updatedAt) < cutoff) {