Fixed supervisor cycling
This commit is contained in:
parent
7c744a8d23
commit
084f895897
6
bot.py
6
bot.py
@ -218,17 +218,19 @@ def thread_supervisor():
|
|||||||
for uid in vk_tokens.scan_iter():
|
for uid in vk_tokens.scan_iter():
|
||||||
tries = 0
|
tries = 0
|
||||||
while check_thread(uid.decode("utf-8")):
|
while check_thread(uid.decode("utf-8")):
|
||||||
if tries < 6:
|
if tries < 3:
|
||||||
try:
|
try:
|
||||||
create_thread(uid.decode("utf-8"), vk_tokens.get(uid))
|
create_thread(uid.decode("utf-8"), vk_tokens.get(uid))
|
||||||
except:
|
except:
|
||||||
|
time.sleep(10)
|
||||||
tries = tries + 1
|
tries = tries + 1
|
||||||
else:
|
else:
|
||||||
mark = types.InlineKeyboardMarkup()
|
mark = types.InlineKeyboardMarkup()
|
||||||
login = types.InlineKeyboardButton('ВХОД', url=link)
|
login = types.InlineKeyboardButton('ВХОД', url=link)
|
||||||
mark.add(login)
|
mark.add(login)
|
||||||
bot.send_message(uid.decode("utf-8"), '<b>Непредвиденная ошибка, требуется повторный логин ВК!</b>',
|
bot.send_message(uid.decode("utf-8"), '<b>Непредвиденная ошибка, требуется повторный логин ВК!</b>',
|
||||||
parse_mode='HTML', reply_markup=mark)
|
parse_mode='HTML', reply_markup=mark).wait()
|
||||||
|
break
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user