This commit is contained in:
jxxghp
2023-07-05 11:25:05 +08:00
parent 0573d6beff
commit 3538a04870
3 changed files with 11 additions and 19 deletions

View File

@ -51,7 +51,7 @@ async def get_progress(token: str):
async def event_generator():
while True:
detail = message.get()
yield 'data: %s\n\n' % detail
await asyncio.sleep(1)
yield 'data: %s\n\n' % (detail or '')
await asyncio.sleep(3)
return StreamingResponse(event_generator(), media_type="text/event-stream")