diff --git a/LichessClientTG_bot/config.py b/LichessClientTG_bot/config.py index f6ab393..f3f17f3 100644 --- a/LichessClientTG_bot/config.py +++ b/LichessClientTG_bot/config.py @@ -27,6 +27,8 @@ else: # Lichess API Configuration LICHESS_API_BASE_URL = "https://lichess.org/api" LICHESS_STATS_API_BASE_URL = "http://localhost:8001" # For Docker container access +# Минимальная задержка (сек) между запросами к Lichess в очереди мониторинга (избежание бана) +LICHESS_REQUEST_QUEUE_MIN_DELAY = 5.0 # Database Configuration def _resolve_database_path() -> str: diff --git a/LichessClientTG_bot/request_queue.py b/LichessClientTG_bot/request_queue.py index d0c0efc..3a81a3d 100644 --- a/LichessClientTG_bot/request_queue.py +++ b/LichessClientTG_bot/request_queue.py @@ -7,6 +7,8 @@ import logging from typing import Callable, Any, Optional, Dict from datetime import datetime +import config + logger = logging.getLogger(__name__) class RequestQueue: @@ -139,6 +141,6 @@ def get_request_queue() -> RequestQueue: """Get the global request queue instance""" global _request_queue if _request_queue is None: - _request_queue = RequestQueue(min_delay=7.0) + _request_queue = RequestQueue(min_delay=config.LICHESS_REQUEST_QUEUE_MIN_DELAY) return _request_queue