From 41c0e3683841c0b276bafedc7162cd01bdd763c2 Mon Sep 17 00:00:00 2001 From: Kylmakalle Date: Thu, 13 Jul 2017 15:21:57 +0300 Subject: [PATCH] Fixed supervisor cycling --- bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 52ea4d3..8762e26 100644 --- a/bot.py +++ b/bot.py @@ -215,17 +215,19 @@ def thread_supervisor(): for uid in vk_tokens.scan_iter(): tries = 0 while check_thread(uid.decode("utf-8")): - if tries < 6: + if tries < 3: try: create_thread(uid.decode("utf-8"), vk_tokens.get(uid)) except: + time.sleep(10) tries = tries + 1 else: mark = types.InlineKeyboardMarkup() login = types.InlineKeyboardButton('ВХОД', url=link) mark.add(login) bot.send_message(uid.decode("utf-8"), 'Непредвиденная ошибка, требуется повторный логин ВК!', - parse_mode='HTML', reply_markup=mark) + parse_mode='HTML', reply_markup=mark).wait() + break time.sleep(60)