mirror of
https://github.com/tgbot-collection/YYeTsBot.git
synced 2025-11-25 03:15:05 +08:00
num_threads
change it to 100 to make it work - temp solution
This commit is contained in:
@@ -107,6 +107,10 @@ python /path/to/YYeTsBot/yyetsbot/bot.py
|
||||
## health check
|
||||
有时不知为何遇到了bot卡死,无任何反馈。😂这个时候需要client api了😂
|
||||
|
||||
好的,这个原因找到了,是因为有时爬虫会花费比较长的时间,然后pytelegrambotapi默认只有两个线程,那么后续的操作就会被阻塞住。
|
||||
|
||||
临时的解决办法是增加线程数量,长期的解决办法是使用celery分发任务。
|
||||
|
||||
# Credits
|
||||
|
||||
* [人人影视](http://www.zmz2019.com/)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
requests
|
||||
pytelegrambotapi
|
||||
pytelegrambotapi==3.7.6
|
||||
beautifulsoup4
|
||||
tgbot-ping
|
||||
redis
|
||||
|
||||
@@ -29,7 +29,7 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(filename)s [%(le
|
||||
if PROXY:
|
||||
apihelper.proxy = {'http': PROXY}
|
||||
|
||||
bot = telebot.TeleBot(TOKEN)
|
||||
bot = telebot.TeleBot(TOKEN, num_threads=100)
|
||||
angry_count = 0
|
||||
|
||||
|
||||
@@ -365,4 +365,4 @@ if __name__ == '__main__':
|
||||
scheduler = BackgroundScheduler()
|
||||
scheduler.add_job(reset_request, 'cron', hour=0, minute=0)
|
||||
scheduler.start()
|
||||
bot.polling()
|
||||
bot.polling()
|
||||
|
||||
Reference in New Issue
Block a user