bettermint commited on
Commit
bee0860
·
verified ·
1 Parent(s): 9180f7f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +14 -10
main.py CHANGED
@@ -94,11 +94,13 @@ async def websocket_endpoint(websocket: WebSocket, version: str):
94
 
95
  try:
96
  while True:
97
- res = stockfish.read_line()
98
- if res:
99
- await websocket.send_text(f"{res}")
100
- else:
101
- break
 
 
102
  finally:
103
  user_playing['total'] -= 1
104
  user_playing['stockfish'] -= 1
@@ -121,11 +123,13 @@ async def websocket_endpoint(websocket: WebSocket, elo: str):
121
 
122
  try:
123
  while True:
124
- res = stockfish.read_line()
125
- if res:
126
- await websocket.send_text(f"{res}")
127
- else:
128
- break
 
 
129
  finally:
130
  user_playing['total'] -= 1
131
  user_playing['maia'] -= 1
 
94
 
95
  try:
96
  while True:
97
+ while True:
98
+ res = stockfish.read_line()
99
+ if res:
100
+ await websocket.send_text(f"{res}")
101
+ else:
102
+ break
103
+ await asyncio.sleep(0.1)
104
  finally:
105
  user_playing['total'] -= 1
106
  user_playing['stockfish'] -= 1
 
123
 
124
  try:
125
  while True:
126
+ while True:
127
+ res = stockfish.read_line()
128
+ if res:
129
+ await websocket.send_text(f"{res}")
130
+ else:
131
+ break
132
+ await asyncio.sleep(0.1)
133
  finally:
134
  user_playing['total'] -= 1
135
  user_playing['maia'] -= 1