Update r2.py
Browse files
r2.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
-
# r2.py (محدث V10.
|
| 2 |
import os, traceback, json, time
|
| 3 |
from datetime import datetime, timedelta
|
| 4 |
import asyncio
|
| 5 |
import boto3
|
| 6 |
from botocore.exceptions import NoCredentialsError, ClientError
|
|
|
|
| 7 |
|
| 8 |
R2_ACCOUNT_ID = os.getenv("R2_ACCOUNT_ID")
|
| 9 |
R2_ACCESS_KEY_ID = os.getenv("R2_ACCESS_KEY_ID")
|
|
@@ -323,7 +324,7 @@ class R2Service:
|
|
| 323 |
if updated:
|
| 324 |
await self.save_open_trades_async(open_trades)
|
| 325 |
status = "ENABLED" if is_monitored else "DISABLED"
|
| 326 |
-
print(f"✅ Real-time monitoring {
|
| 327 |
else:
|
| 328 |
print(f"⚠️ Trade {symbol} not found for monitoring status update")
|
| 329 |
return updated
|
|
|
|
| 1 |
+
# r2.py (محدث V10.3 - Typing Fix)
|
| 2 |
import os, traceback, json, time
|
| 3 |
from datetime import datetime, timedelta
|
| 4 |
import asyncio
|
| 5 |
import boto3
|
| 6 |
from botocore.exceptions import NoCredentialsError, ClientError
|
| 7 |
+
from typing import List, Dict, Any, Optional # <-- 🔴 السطر المضاف لإصلاح الخطأ
|
| 8 |
|
| 9 |
R2_ACCOUNT_ID = os.getenv("R2_ACCOUNT_ID")
|
| 10 |
R2_ACCESS_KEY_ID = os.getenv("R2_ACCESS_KEY_ID")
|
|
|
|
| 324 |
if updated:
|
| 325 |
await self.save_open_trades_async(open_trades)
|
| 326 |
status = "ENABLED" if is_monitored else "DISABLED"
|
| 327 |
+
print(f"✅ Real-time monitoring {status} for {symbol}")
|
| 328 |
else:
|
| 329 |
print(f"⚠️ Trade {symbol} not found for monitoring status update")
|
| 330 |
return updated
|