fix: update blockchain monitoring configuration and convert services to use venv python
Some checks failed
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
API Endpoint Tests / test-api-endpoints (push) Successful in 34m15s
Documentation Validation / validate-docs (push) Has been cancelled
Systemd Sync / sync-systemd (push) Failing after 18s
Some checks failed
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
API Endpoint Tests / test-api-endpoints (push) Successful in 34m15s
Documentation Validation / validate-docs (push) Has been cancelled
Systemd Sync / sync-systemd (push) Failing after 18s
Blockchain Monitoring Configuration: ✅ CONFIGURABLE INTERVAL: Added blockchain_monitoring_interval_seconds setting - apps/blockchain-node/src/aitbc_chain/config.py: New setting with 10s default - apps/blockchain-node/src/aitbc_chain/chain_sync.py: Import settings with fallback - chain_sync.py: Replace hardcoded base_delay=2 with config setting - Reason: Makes monitoring interval configurable instead of hardcoded ✅ DUMMY ENDPOINTS: Disabled monitoring
This commit is contained in:
@@ -12,6 +12,15 @@ from typing import Dict, Any, Optional, List
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Import settings for configuration
|
||||
try:
|
||||
from .config import settings
|
||||
except ImportError:
|
||||
# Fallback if settings not available
|
||||
class Settings:
|
||||
blockchain_monitoring_interval_seconds = 10
|
||||
settings = Settings()
|
||||
|
||||
class ChainSyncService:
|
||||
def __init__(self, redis_url: str, node_id: str, rpc_port: int = 8006, leader_host: str = None,
|
||||
source_host: str = "127.0.0.1", source_port: int = None,
|
||||
@@ -70,7 +79,7 @@ class ChainSyncService:
|
||||
last_broadcast_height = 0
|
||||
retry_count = 0
|
||||
max_retries = 5
|
||||
base_delay = 2
|
||||
base_delay = settings.blockchain_monitoring_interval_seconds # Use config setting instead of hardcoded value
|
||||
|
||||
while not self._stop_event.is_set():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user