Commit 109e8ab
authored
fix(telegram): add explicit read_timeout for get_updates polling (#173)
On macOS, when the machine sleeps and wakes up (e.g. closing and
reopening a MacBook), the existing long-polling connection can become
stale. PTB may then reuse this dead connection from its pool, and
without an explicit client-side read_timeout it can hang indefinitely,
leaving the bot completely unresponsive.
Set an explicit HTTPXRequest(read_timeout=30) for get_updates so that
hanging connections are capped at 30s before being discarded and
retried.1 parent 2ed867b commit 109e8ab
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
| 173 | + | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
0 commit comments