Remove deprecated app_new.py and consolidate main application logic into main.py
- Deleted `app_new.py`, which was previously the main entry point for the dashboard application, to streamline the codebase. - Consolidated the application initialization and callback registration logic into `main.py`, enhancing modularity and maintainability. - Updated the logging and error handling practices in `main.py` to ensure consistent application behavior and improved debugging capabilities. These changes simplify the application structure, aligning with project standards for modularity and maintainability.
This commit is contained in:
@@ -27,6 +27,7 @@ class ConnectionManager:
|
||||
reconnect_delay: float = 5.0,
|
||||
logger=None,
|
||||
state_telemetry: CollectorStateAndTelemetry = None):
|
||||
|
||||
self.exchange_name = exchange_name
|
||||
self.component_name = component_name
|
||||
self._max_reconnect_attempts = max_reconnect_attempts
|
||||
|
||||
@@ -7,6 +7,7 @@ and trade data aggregation.
|
||||
|
||||
import re
|
||||
from typing import List, Tuple
|
||||
from utils.timeframe_utils import load_timeframe_options
|
||||
|
||||
from ..data_types import StandardizedTrade, OHLCVCandle
|
||||
|
||||
@@ -42,7 +43,7 @@ def validate_timeframe(timeframe: str) -> bool:
|
||||
Returns:
|
||||
True if supported, False otherwise
|
||||
"""
|
||||
supported = ['1s', '5s', '10s', '15s', '30s', '1m', '5m', '15m', '30m', '1h', '4h', '1d']
|
||||
supported = [item['value'] for item in load_timeframe_options()]
|
||||
return timeframe in supported
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ from decimal import Decimal
|
||||
from typing import Dict, List, Optional, Any
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
import asyncio
|
||||
|
||||
from utils.timeframe_utils import load_timeframe_options
|
||||
|
||||
# from ..base_collector import DataType, MarketDataPoint # Import from base
|
||||
|
||||
@@ -140,6 +141,12 @@ class OHLCVCandle:
|
||||
}
|
||||
|
||||
|
||||
def _load_supported_timeframes():
|
||||
"""Loads supported timeframe values from a JSON file."""
|
||||
data = load_timeframe_options()
|
||||
return [item['value'] for item in data]
|
||||
|
||||
|
||||
@dataclass
|
||||
class CandleProcessingConfig:
|
||||
"""Configuration for candle processing - shared across exchanges."""
|
||||
@@ -150,7 +157,7 @@ class CandleProcessingConfig:
|
||||
|
||||
def __post_init__(self):
|
||||
"""Validate configuration after initialization."""
|
||||
supported_timeframes = ['1s', '5s', '10s', '15s', '30s', '1m', '5m', '15m', '30m', '1h', '4h', '1d']
|
||||
supported_timeframes = _load_supported_timeframes()
|
||||
for tf in self.timeframes:
|
||||
if tf not in supported_timeframes:
|
||||
raise ValueError(f"Unsupported timeframe: {tf}")
|
||||
|
||||
Reference in New Issue
Block a user