inline keyboard and move to channel with threads

Signed-off-by: Omar Sánchez Pizarro <omar.sanchez@pistacero.net>
This commit is contained in:
Omar Sánchez Pizarro
2025-10-10 02:45:55 +02:00
parent 967f7e52a2
commit fa79e53950
6 changed files with 272 additions and 18 deletions

View File

@@ -4,6 +4,7 @@ import logging
from datalayer.wallapop_article import WallapopArticle
import traceback
REQUEST_SLEEP_TIME = 30
REQUEST_RETRY_TIME = 5
ERROR_SLEEP_TIME = 60
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
@@ -121,7 +122,7 @@ class Worker:
for article in articles:
if self._meets_item_conditions(article):
try:
self._queue_manager.add_to_queue(article, self._item_monitoring.get_name())
self._queue_manager.add_to_queue(article, self._item_monitoring.get_name(), self._item_monitoring.get_thread_id())
except Exception as e:
self.logger.error(f"{self._item_monitoring.get_name()} worker crashed: {e}")
time.sleep(self._item_monitoring.get_check_every())