Fixed account_checker

This commit is contained in:
Joan Cano
2023-07-04 22:39:26 +02:00
parent cf1d6593a6
commit addf9302c6
3 changed files with 28 additions and 13 deletions

View File

@@ -314,9 +314,9 @@ async def remove_product(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
if walladb.remove_product({'product_name' : product_name, \
'telegram_user_id' : telegram_user_id}):
message = f"¡{product_name} borrado de la lista de seguimiento!"
product_thread = helpers.get_thread(product_name)
if product_thread != None:
product_thread.stop()
#product_thread = helpers.get_thread(product_name)
#if product_thread != None:
# product_thread.stop()
await context.bot.send_message(chat_id=update.effective_chat.id, text=message)
return ConversationHandler.END
@@ -446,7 +446,7 @@ def main()->None:
p.start()
SEARCH_THREADS_LIST.append((product, p))
p = threading.Thread(target=account_checker.account_checker, args=(3600))
p = threading.Thread(target=account_checker.account_checker, args=(3600, ))
p.start()
"""Start the bot."""