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:
parent
687d0b4208
commit
afec11e21b
@ -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.`,
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user