Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,9 +10,9 @@ import time
|
|
| 10 |
from contextlib import asynccontextmanager
|
| 11 |
from fastapi import FastAPI, HTTPException
|
| 12 |
from datetime import datetime
|
| 13 |
-
# 🔴 ---
|
| 14 |
from typing import List, Dict, Any # (إضافة الاستيراد الناقص)
|
| 15 |
-
# 🔴 ---
|
| 16 |
|
| 17 |
# استيراد الخدمات (بما في ذلك TradeManager المحدث)
|
| 18 |
try:
|
|
@@ -85,7 +85,11 @@ async def initialize_services():
|
|
| 85 |
|
| 86 |
print(" 🔄 تهيئة مراقب الحيتان (Layer 1 Data)...");
|
| 87 |
try:
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
symbol_whale_monitor_global = EnhancedWhaleMonitor(contracts_database, r2_service_global)
|
| 90 |
state_manager.set_service_initialized('symbol_whale_monitor'); print(" ✅ مراقب الحيتان مهيأ")
|
| 91 |
except Exception as e: print(f" ⚠️ فشل تهيئة مراقب الحيتان: {e}"); symbol_whale_monitor_global = None
|
|
@@ -212,7 +216,7 @@ async def process_batch_parallel(batch, ml_processor, batch_num, total_batches,
|
|
| 212 |
|
| 213 |
async def run_3_layer_analysis_explorer() -> List[Dict[str, Any]]:
|
| 214 |
"""
|
| 215 |
-
(
|
| 216 |
ينشئ "قائمة مراقبة" (Watchlist) للحارس (Sentry).
|
| 217 |
"""
|
| 218 |
|
|
@@ -441,7 +445,7 @@ async def re_analyze_open_trade_async(trade_data):
|
|
| 441 |
|
| 442 |
async def run_bot_cycle_async():
|
| 443 |
"""
|
| 444 |
-
(
|
| 445 |
"""
|
| 446 |
try:
|
| 447 |
if not await state_manager.wait_for_initialization():
|
|
|
|
| 10 |
from contextlib import asynccontextmanager
|
| 11 |
from fastapi import FastAPI, HTTPException
|
| 12 |
from datetime import datetime
|
| 13 |
+
# 🔴 --- (لا تغيير هنا) --- 🔴
|
| 14 |
from typing import List, Dict, Any # (إضافة الاستيراد الناقص)
|
| 15 |
+
# 🔴 --- (لا تغيير هنا) --- 🔴
|
| 16 |
|
| 17 |
# استيراد الخدمات (بما في ذلك TradeManager المحدث)
|
| 18 |
try:
|
|
|
|
| 85 |
|
| 86 |
print(" 🔄 تهيئة مراقب الحيتان (Layer 1 Data)...");
|
| 87 |
try:
|
| 88 |
+
# 🔴 --- START OF CHANGE --- 🔴
|
| 89 |
+
# (تم تغيير هذا السطر ليشير إلى المسار الجديد)
|
| 90 |
+
from whale_monitor.core import EnhancedWhaleMonitor
|
| 91 |
+
# 🔴 --- END OF CHANGE --- 🔴
|
| 92 |
+
|
| 93 |
symbol_whale_monitor_global = EnhancedWhaleMonitor(contracts_database, r2_service_global)
|
| 94 |
state_manager.set_service_initialized('symbol_whale_monitor'); print(" ✅ مراقب الحيتان مهيأ")
|
| 95 |
except Exception as e: print(f" ⚠️ فشل تهيئة مراقب الحيتان: {e}"); symbol_whale_monitor_global = None
|
|
|
|
| 216 |
|
| 217 |
async def run_3_layer_analysis_explorer() -> List[Dict[str, Any]]:
|
| 218 |
"""
|
| 219 |
+
(لا تغيير) - هذا هو "المستكشف" (Layer 1).
|
| 220 |
ينشئ "قائمة مراقبة" (Watchlist) للحارس (Sentry).
|
| 221 |
"""
|
| 222 |
|
|
|
|
| 445 |
|
| 446 |
async def run_bot_cycle_async():
|
| 447 |
"""
|
| 448 |
+
(لا تغيير) - دورة البوت الرئيسية (المستكشف)
|
| 449 |
"""
|
| 450 |
try:
|
| 451 |
if not await state_manager.wait_for_initialization():
|