Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -11,15 +11,12 @@ def root():
|
|
| 11 |
|
| 12 |
def start_driver():
|
| 13 |
print("[INFO] Starting shadow driver...", flush=True)
|
| 14 |
-
subprocess.call(["/entrypoint.sh"])
|
| 15 |
|
| 16 |
def start_api():
|
| 17 |
print("[INFO] FastAPI running on port 8000", flush=True)
|
| 18 |
uvicorn.run(app, host="0.0.0.0", port=8000)
|
| 19 |
|
| 20 |
-
if
|
| 21 |
-
# Start driver in a background thread
|
| 22 |
threading.Thread(target=start_driver, daemon=True).start()
|
| 23 |
-
|
| 24 |
-
# Start API in main thread
|
| 25 |
-
start_api()
|
|
|
|
| 11 |
|
| 12 |
def start_driver():
|
| 13 |
print("[INFO] Starting shadow driver...", flush=True)
|
| 14 |
+
subprocess.call(["/entrypoint.sh"])
|
| 15 |
|
| 16 |
def start_api():
|
| 17 |
print("[INFO] FastAPI running on port 8000", flush=True)
|
| 18 |
uvicorn.run(app, host="0.0.0.0", port=8000)
|
| 19 |
|
| 20 |
+
if name == "main":
|
|
|
|
| 21 |
threading.Thread(target=start_driver, daemon=True).start()
|
| 22 |
+
start_api()
|
|
|
|
|
|