delay in config and setup = 5sec
This commit is contained in:
parent
2ac38440da
commit
0de0deb14f
2 changed files with 5 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue