Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,11 @@ async def send_wss_request():
|
|
26 |
await asyncio.sleep(30 * 60)
|
27 |
|
28 |
def run_websocket():
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
|
31 |
# Create a thread for the WebSocket function
|
32 |
websocket_thread = threading.Thread(target=run_websocket)
|
|
|
26 |
await asyncio.sleep(30 * 60)
|
27 |
|
28 |
def run_websocket():
|
29 |
+
# Create a new event loop for the thread
|
30 |
+
loop = asyncio.new_event_loop()
|
31 |
+
asyncio.set_event_loop(loop)
|
32 |
+
|
33 |
+
loop.run_until_complete(send_wss_request())
|
34 |
|
35 |
# Create a thread for the WebSocket function
|
36 |
websocket_thread = threading.Thread(target=run_websocket)
|