Update run.py
Browse files
run.py
CHANGED
|
@@ -95,11 +95,9 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
| 95 |
except WebSocketDisconnect:
|
| 96 |
print("Client disconnected")
|
| 97 |
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
recorder_thread.start()
|
| 103 |
recorder_ready.wait()
|
| 104 |
-
|
| 105 |
-
print("Server started. Press Ctrl+C to stop the server.")
|
|
|
|
| 95 |
except WebSocketDisconnect:
|
| 96 |
print("Client disconnected")
|
| 97 |
|
| 98 |
+
@app.on_event("startup")
|
| 99 |
+
async def startup_event():
|
| 100 |
+
recorder_thread_instance = threading.Thread(target=recorder_thread)
|
| 101 |
+
recorder_thread_instance.start()
|
|
|
|
| 102 |
recorder_ready.wait()
|
| 103 |
+
print("Server started. Press Ctrl+C to stop the server."
|
|
|