You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
First sync: pace history calls to what Telegram allows, not a fixed 3 s #133
A first sync of a real account (about 2,600 chats with sync on, about 800,000 messages) took about 11 hours of active time with 0.8.0. Measured from sync_jobs and status.jsonl:
9,986 messages.getHistory calls, one every ~4.1 s (0.25 calls/s). A call took 204 ms at the median (p90 507 ms), writing a page ~10 ms.
About 92% of the active time was the pause between jobs. The 3 s interJobDelayMs becomes ~3.8 s because a job is picked on the main loop's next 1 s tick.
Not a single FLOOD_WAIT on getHistory the whole time.
A probe on a test account (getHistory, 100 per page, one public channel, closed loop) got its first FLOOD_WAIT at 1 call/s after 70–100 calls, with short waits (3–15 s) that grew under pressure; through them it sustained 0.85–0.95 calls/s. 0.7 calls/s ran 150 s with none. Two chats in parallel brought no gain. Whether the counter is per chat, per method or per account is unknown.
Proposed:
Measure the pause from when a job starts, or pick jobs on their own timer, so the 3 s really is 3 s (×1.2).
Adaptive pacing while history is pending: start at ~0.7 calls/s, speed up after clean runs up to a cap (~0.8–0.9/s), halve on a FLOOD_WAIT, and go back to the calm interval once the first pass is done. Expected: the first sync in ~3–4 hours of active time instead of ~11.
Parallel jobs per account and takeout sessions only after measurements. Done when a test with an injected clock and fake FLOOD_WAITs covers speed-up and back-off, a one-to-two-hour run on the test account shows the rate and no long FLOOD_WAIT, and docs/rate-limiting.md and docs/sync-strategy.md describe the pacing. Related: #126.
Activity
fix(daemon): slow history down only on FLOOD_WAITs of history pages
feat(daemon): adaptive pacing for history sync
fix(daemon): slow history down only on FLOOD_WAITs of history pages
fix(daemon): keep the history back-off floor apart from the calm inte…
fix(daemon): slow history down only on FLOOD_WAITs of history pages
fix(daemon): keep the history back-off floor apart from the calm inte…
test(search): keep one owner per history and search contract