MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / estimateRemainingTime

Method estimateRemainingTime

clean/clean.ts:558–568  ·  view source on GitHub ↗
(processed: number, total: number, elapsedMs: number)

Source from the content-addressed store, hash-verified

556 }
557 }
558
559 private getDynamicDelay(user: any, includeAll: boolean, consecutiveErrors: number): number {
560 let delay = 200;
561
562 if (user.bot) delay = 1500;
563 else if (user.scam || user.fake) delay = 800;
564
565 if (includeAll) delay = Math.max(delay, 1000);
566 if (consecutiveErrors > 0) delay = delay * (1 + consecutiveErrors * 0.5);
567
568 return Math.min(delay, 5000);
569 }
570
571 private async updateBlockedProgress(msg: Api.Message, processed: number, total: number,

Callers 1

updateBlockedProgressMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected