Update app.py
Browse files
app.py
CHANGED
|
@@ -1053,11 +1053,16 @@ async def run_translation_job(request_id, text, source_lang, target_lang, notifi
|
|
| 1053 |
payload = {
|
| 1054 |
"request_id": request_id,
|
| 1055 |
"status": "completed",
|
| 1056 |
-
"translated_text": translated_text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1057 |
}
|
| 1058 |
try:
|
| 1059 |
r = requests.post(notification_url, json=payload, verify=False, timeout=10)
|
| 1060 |
-
print(f"📡 Sent notify for {request_id}, status={r.status_code}
|
| 1061 |
except Exception as e:
|
| 1062 |
print(f"❌ Notify failed for {request_id}: {e}")
|
| 1063 |
|
|
|
|
| 1053 |
payload = {
|
| 1054 |
"request_id": request_id,
|
| 1055 |
"status": "completed",
|
| 1056 |
+
"translated_text": translated_text,
|
| 1057 |
+
"processing_time": result['processing_time'],
|
| 1058 |
+
"character_count": len(text),
|
| 1059 |
+
"translation_length": len(translated_text),
|
| 1060 |
+
"from_cache": result.get('from_cache', False),
|
| 1061 |
+
"auto_charge": auto_charge # Add this line
|
| 1062 |
}
|
| 1063 |
try:
|
| 1064 |
r = requests.post(notification_url, json=payload, verify=False, timeout=10)
|
| 1065 |
+
print(f"📡 Sent notify for {request_id}, status={r.status_code}")
|
| 1066 |
except Exception as e:
|
| 1067 |
print(f"❌ Notify failed for {request_id}: {e}")
|
| 1068 |
|