Browse Source

Re-enable copy trading monitor with non-blocking state management

- Initialized the copy trading monitor in MonitoringCoordinator, addressing previous blocking issues.
- Updated logging messages to reflect the non-blocking state manager during initialization and startup of the copy trading monitor.
Carles Sentis 5 days ago
parent
commit
2a85149b8d
2 changed files with 4 additions and 7 deletions
  1. 3 6
      src/monitoring/monitoring_coordinator.py
  2. 1 1
      trading_bot.py

+ 3 - 6
src/monitoring/monitoring_coordinator.py

@@ -43,11 +43,8 @@ class MonitoringCoordinator:
         # Initialize copy trading monitor if available
         if COPY_TRADING_AVAILABLE:
             try:
-                # DISABLE: Still causing blocking issues despite timeouts
-                # self.copy_trading_monitor = CopyTradingMonitor(hl_client, notification_manager)
-                # logger.info("✅ Copy trading monitor initialized (non-blocking version)")
-                self.copy_trading_monitor = None
-                logger.info("🚫 Copy trading monitor disabled - still causing blocking issues")
+                self.copy_trading_monitor = CopyTradingMonitor(hl_client, notification_manager)
+                logger.info("✅ Copy trading monitor initialized (with non-blocking state manager)")
             except Exception as e:
                 logger.error(f"❌ Failed to initialize copy trading monitor: {e}")
                 self.copy_trading_monitor = None
@@ -83,7 +80,7 @@ class MonitoringCoordinator:
             if self.copy_trading_monitor and hasattr(self.copy_trading_monitor, 'enabled') and self.copy_trading_monitor.enabled:
                 try:
                     asyncio.create_task(self.copy_trading_monitor.start_monitoring())
-                    logger.info("🔄 Copy trading monitor started (non-blocking)")
+                    logger.info("🔄 Copy trading monitor started (with non-blocking state manager)")
                 except Exception as e:
                     logger.error(f"❌ Failed to start copy trading monitor: {e}")
             

+ 1 - 1
trading_bot.py

@@ -14,7 +14,7 @@ from datetime import datetime
 from pathlib import Path
 
 # Bot version
-BOT_VERSION = "3.0.319"
+BOT_VERSION = "3.0.320"
 
 # Add src directory to Python path
 sys.path.insert(0, str(Path(__file__).parent / "src"))