Browse Source

Refactor set_initial_balance method to remove async/await, improving code simplicity and performance. The method now directly interacts with the database manager for setting the initial balance.

Carles Sentis 2 days ago
parent
commit
5be22908ce
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/stats/trading_stats.py
  2. 1 1
      trading_bot.py

+ 2 - 2
src/stats/trading_stats.py

@@ -57,9 +57,9 @@ class TradingStats:
     # DATABASE MANAGEMENT DELEGATION
     # =============================================================================
     
-    async def set_initial_balance(self, balance: float):
+    def set_initial_balance(self, balance: float):
         """Set initial balance."""
-        return await self.db_manager.set_initial_balance(balance)
+        return self.db_manager.set_initial_balance(balance)
     
     def get_initial_balance(self) -> float:
         """Get initial balance."""

+ 1 - 1
trading_bot.py

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