🎨 Set the specifies the maximum amount of time to wait for a write operation to complete to 10 seconds

This commit is contained in:
洛水居室 2022-10-15 23:48:53 +08:00
parent 3f91314c65
commit 8cf18e2f95
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -234,7 +234,7 @@ class Bot:
try:
for _ in range(5):
try:
self.app.run_polling(close_loop=False)
self.app.run_polling(close_loop=False, write_timeout=10)
break
except TimedOut:
logger.warning("连接至 [blue]telegram[/] 服务器失败,正在重试", extra={"markup": True})