Skip to content

Commit 12c9bdb

Browse files
authored
fix(offline_download): prevent infinite retry on status update failure (#2294)
1 parent 9e49adc commit 12c9bdb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/offline_download/tool/download.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ func (t *DownloadTask) Update() (bool, error) {
147147
if err != nil {
148148
t.callStatusRetried++
149149
log.Errorf("failed to get status of %s, retried %d times", t.ID, t.callStatusRetried)
150+
if t.callStatusRetried > 5 {
151+
return true, errors.Errorf("failed to get status of %s, retried %d times", t.ID, t.callStatusRetried)
152+
}
150153
return false, nil
151154
}
152-
if t.callStatusRetried > 5 {
153-
return true, errors.Errorf("failed to get status of %s, retried %d times", t.ID, t.callStatusRetried)
154-
}
155155
t.callStatusRetried = 0
156156
t.SetProgress(info.Progress)
157157
t.SetTotalBytes(info.TotalBytes)

0 commit comments

Comments
 (0)