fix: off-by-one in stall restart escalation

Change >= to > so the process exit fires after MAX_CONSECUTIVE_POLL_RESTARTS
actual restart attempts rather than exiting on the Nth detection before
the Nth restart has a chance to recover. A transient outage that would
recover on the 5th retry no longer gets killed early.
This commit is contained in:
Tom Alison 2026-03-14 14:24:45 -07:00
parent 687d0b4208
commit afec11e21b

View File

@ -234,7 +234,7 @@ export class TelegramPollingSession {
if (elapsed > POLL_STALL_THRESHOLD_MS && runner.isRunning()) {
this.#consecutiveStallRestarts += 1;
stalledRestart = true;
if (this.#consecutiveStallRestarts >= MAX_CONSECUTIVE_POLL_RESTARTS) {
if (this.#consecutiveStallRestarts > MAX_CONSECUTIVE_POLL_RESTARTS) {
this.opts.log(
`[telegram] Polling recovery exhausted after ${this.#consecutiveStallRestarts} consecutive stall restarts without successful getUpdates; escalating to process exit.`,
);