ilang-ai commited on
Commit
1acab1c
·
1 Parent(s): c3586dd

fix: bootstrap_retries=10 + 30s timeouts for HF Space network

Browse files

HF Space had ConnectTimeout on first Telegram API call.
Default bootstrap_retries=0 means instant abort.
Now retries 10 times with 30s timeouts.

Files changed (1) hide show
  1. bot.py +5 -2
bot.py CHANGED
@@ -490,8 +490,11 @@ def main():
490
  app.run_polling(
491
  drop_pending_updates=True,
492
  allowed_updates=["message", "callback_query", "my_chat_member"],
493
- poll_interval=2,
494
- timeout=30
 
 
 
495
  )
496
 
497
 
 
490
  app.run_polling(
491
  drop_pending_updates=True,
492
  allowed_updates=["message", "callback_query", "my_chat_member"],
493
+ connect_timeout=30,
494
+ read_timeout=30,
495
+ write_timeout=30,
496
+ pool_timeout=30,
497
+ bootstrap_retries=10
498
  )
499
 
500