Spaces:
Runtime error
Runtime error
Update entrypoint.sh
Browse files- entrypoint.sh +9 -10
entrypoint.sh
CHANGED
|
@@ -1,12 +1,11 @@
|
|
| 1 |
-
|
| 2 |
-
import os
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
"url": f"{SPACE_URL}/webhook"
|
| 10 |
-
}
|
| 11 |
-
response = requests.post(url, json=params)
|
| 12 |
-
print("Webhook set response:", response.json())
|
|
|
|
| 1 |
+
#!/bin/bash
|
|
|
|
| 2 |
|
| 3 |
+
# اجرا کردن set_webhook.py فقط یک بار
|
| 4 |
+
if [ ! -f "/app/webhook_set.lock" ]; then
|
| 5 |
+
echo "Setting up Telegram webhook..."
|
| 6 |
+
python /app/set_webhook.py
|
| 7 |
+
touch /app/webhook_set.lock
|
| 8 |
+
fi
|
| 9 |
|
| 10 |
+
# اجرا کردن سرور FastAPI
|
| 11 |
+
exec uvicorn app:app --host 0.0.0.0 --port 7860
|
|
|
|
|
|
|
|
|
|
|
|