Skip to content

Commit

Permalink
🐛 fix: catch semaphore error to improve download stability (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo authored Nov 4, 2024
1 parent 37394a2 commit 244c51f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/yutto/utils/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ async def download_file_with_offset(
error_type = e.__class__.__name__
Logger.warning(f"文件 {file_buffer.file_path} 下载出错({error_type}),尝试重新连接...")
Logger.debug(f"超时链接:{url}")
except ValueError as e:
# 由于 httpx 经常出现此问题,暂时捕获该问题
if "semaphore released too many times" not in str(e):
raise e
Logger.warning(f"文件 {file_buffer.file_path} 下载出错({e}),尝试重新连接...")


def create_client(
Expand Down

0 comments on commit 244c51f

Please sign in to comment.