Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyaboulton committed Apr 4, 2024
1 parent f565a3c commit 8d5a3ab
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions gradio/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,13 @@ async def stop_stream():
# For some reason tests are failing when using events only on CI
# so we use a different approach for CI but
# locally and in deployment we should use the event-based approach
while app.get_blocks().is_running:
await asyncio.sleep(0.25)
return "stop"
# else:
# await app.stop_event.wait()
# return "stop"
if os.getenv("GRADIO_IS_E2E_TEST") and sys.version_info < (3, 9):
while app.get_blocks().is_running:
await asyncio.sleep(0.)
return "stop"
else:
await app.stop_event.wait()
return "stop"

async def iterator():
while True:
Expand Down

0 comments on commit 8d5a3ab

Please sign in to comment.