mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
fix asyncio sleep
This commit is contained in:
@@ -267,7 +267,7 @@ async def get_progress(request: Request, process_type: str, _: schemas.TokenPayl
|
|||||||
break
|
break
|
||||||
detail = progress.get(process_type)
|
detail = progress.get(process_type)
|
||||||
yield f"data: {json.dumps(detail)}\n\n"
|
yield f"data: {json.dumps(detail)}\n\n"
|
||||||
await asyncio.sleep(0.2)
|
await asyncio.sleep(0.5)
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ async def get_logging(request: Request, length: Optional[int] = 50, logfile: Opt
|
|||||||
break
|
break
|
||||||
line = await f.readline()
|
line = await f.readline()
|
||||||
if not line:
|
if not line:
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(1)
|
||||||
continue
|
continue
|
||||||
yield f"data: {line}\n\n"
|
yield f"data: {line}\n\n"
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
|
|||||||
Reference in New Issue
Block a user