Update app.py
Browse files
app.py
CHANGED
|
@@ -98,10 +98,6 @@ async def lifespan(app: FastAPI):
|
|
| 98 |
|
| 99 |
print(" [2/8] تهيئة DataManager...")
|
| 100 |
data_manager = DataManager(contracts_db={}, whale_monitor=None, r2_service=r2)
|
| 101 |
-
# [ 🚀 🚀 🚀 ]
|
| 102 |
-
# [ 💡 💡 💡 ] التصحيح: حذف السطر الخاطئ
|
| 103 |
-
# await data_manager.initialize_exchange() # (تم الحذف - هذا تم إصلاحه في المرة السابقة)
|
| 104 |
-
# [ 🚀 🚀 🚀 ]
|
| 105 |
|
| 106 |
# (هذا تم إصلاحه في المرة السابقة وهو صحيح الآن)
|
| 107 |
await data_manager.initialize()
|
|
@@ -110,14 +106,11 @@ async def lifespan(app: FastAPI):
|
|
| 110 |
# --- 2. تهيئة خدمات الطبقة الثانية (L2 Services) ---
|
| 111 |
print(" [3/8] تهيئة L2 Services (Whales, News, Sentiment)...")
|
| 112 |
|
| 113 |
-
#
|
| 114 |
-
# [ 💡 💡 💡 ] هذا هو التصحيح للخطأ الحالي
|
| 115 |
-
# تم تبديل الوسائط واستخدام الوسائط المسماة (keyword arguments)
|
| 116 |
whale_monitor = EnhancedWhaleMonitor(
|
| 117 |
contracts_db=data_manager.get_contracts_db(),
|
| 118 |
r2_service=r2
|
| 119 |
)
|
| 120 |
-
# [ 🚀 🚀 🚀 ]
|
| 121 |
|
| 122 |
news_fetcher = NewsFetcher()
|
| 123 |
senti_analyzer = SentimentIntensityAnalyzer()
|
|
@@ -129,7 +122,15 @@ async def lifespan(app: FastAPI):
|
|
| 129 |
llm_service = LLMService()
|
| 130 |
|
| 131 |
print(" [5/8] تهيئة LearningHub...")
|
| 132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
await learning_hub.initialize()
|
| 134 |
|
| 135 |
# --- 4. تهيئة محركات الذكاء الاصطناعي (ML Engines) ---
|
|
@@ -187,11 +188,6 @@ async def lifespan(app: FastAPI):
|
|
| 187 |
sys_state.ready = False
|
| 188 |
if trade_manager:
|
| 189 |
await trade_manager.stop_sentry_loops()
|
| 190 |
-
# [ 🚀 🚀 🚀 ]
|
| 191 |
-
# [ 💡 💡 💡 ] التصحيح: حذف السطر الخاطئ
|
| 192 |
-
# if data_manager:
|
| 193 |
-
# await data_manager.close_exchange_session() # (تم الحذف - هذا تم إصلاحه في المرة السابقة)
|
| 194 |
-
# [ 🚀 🚀 🚀 ]
|
| 195 |
|
| 196 |
# (هذا تم إصلاحه في المرة السابقة وهو صحيح الآن)
|
| 197 |
if data_manager:
|
|
|
|
| 98 |
|
| 99 |
print(" [2/8] تهيئة DataManager...")
|
| 100 |
data_manager = DataManager(contracts_db={}, whale_monitor=None, r2_service=r2)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
# (هذا تم إصلاحه في المرة السابقة وهو صحيح الآن)
|
| 103 |
await data_manager.initialize()
|
|
|
|
| 106 |
# --- 2. تهيئة خدمات الطبقة الثانية (L2 Services) ---
|
| 107 |
print(" [3/8] تهيئة L2 Services (Whales, News, Sentiment)...")
|
| 108 |
|
| 109 |
+
# (هذا تم إصلاحه في المرة السابقة وهو صحيح الآن)
|
|
|
|
|
|
|
| 110 |
whale_monitor = EnhancedWhaleMonitor(
|
| 111 |
contracts_db=data_manager.get_contracts_db(),
|
| 112 |
r2_service=r2
|
| 113 |
)
|
|
|
|
| 114 |
|
| 115 |
news_fetcher = NewsFetcher()
|
| 116 |
senti_analyzer = SentimentIntensityAnalyzer()
|
|
|
|
| 122 |
llm_service = LLMService()
|
| 123 |
|
| 124 |
print(" [5/8] تهيئة LearningHub...")
|
| 125 |
+
# [ 🚀 🚀 🚀 ]
|
| 126 |
+
# [ 💡 💡 💡 ] هذا هو التصحيح للخطأ الحالي
|
| 127 |
+
# تم تمرير الوسائط المفقودة (llm_service و data_manager)
|
| 128 |
+
learning_hub = LearningHubManager(
|
| 129 |
+
r2_service=r2,
|
| 130 |
+
llm_service=llm_service,
|
| 131 |
+
data_manager=data_manager
|
| 132 |
+
)
|
| 133 |
+
# [ 🚀 🚀 🚀 ]
|
| 134 |
await learning_hub.initialize()
|
| 135 |
|
| 136 |
# --- 4. تهيئة محركات الذكاء الاصطناعي (ML Engines) ---
|
|
|
|
| 188 |
sys_state.ready = False
|
| 189 |
if trade_manager:
|
| 190 |
await trade_manager.stop_sentry_loops()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
# (هذا تم إصلاحه في المرة السابقة وهو صحيح الآن)
|
| 193 |
if data_manager:
|