clone3 commited on
Commit
e3ab212
1 Parent(s): 75ddb00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -26,7 +26,11 @@ async def send_wss_request():
26
  await asyncio.sleep(30 * 60)
27
 
28
  def run_websocket():
29
- asyncio.get_event_loop().run_until_complete(send_wss_request())
 
 
 
 
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)