mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
perf: throttle trusted mute pruning
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
d569e1474e
commit
f7ebad4b2f
6 files changed
+9451
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user