Skip to content

Commit

Permalink
fix: 重试下载的时候给个debug日志,并且重置进度条
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed May 20, 2024
1 parent e7675b3 commit c7fec2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export class Cluster {
try {
const res = await pRetry(
() => {
bar.update(0)
return this.got
.get<Buffer>(file.path.substring(1), {
searchParams: {
Expand All @@ -206,6 +207,9 @@ export class Cluster {
},
{
retries: 10,
onFailedAttempt: (e) => {
logger.debug({err: e}, `下载文件${file.path}失败,正在重试`)
},
},
)
const isFileCorrect = validateFile(res.body, file.hash)
Expand Down

0 comments on commit c7fec2f

Please sign in to comment.