Skip to content

Commit

Permalink
fix(getter): simplify strategy loop
Browse files Browse the repository at this point in the history
Co-authored-by: istae <[email protected]>
  • Loading branch information
zelig and istae authored Jan 15, 2024
1 parent 5e3adfd commit 4a81fc3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/file/redundancy/getter/strategies.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ func (g *decoder) prefetch(ctx context.Context, strategy int, strict bool, strat
return g.recover(ctx) // context to cancel when shardCnt chunks are retrieved
}
var err error
for s := strategy; s == strategy || (err != nil && !strict && s < strategyCnt); s++ {
for s := strategy; s < strategyCnt; s++ {
err = run(s)
if err != nil || strict {
return
}
}
err = run(s)
}
}

Check failure on line 104 in pkg/file/redundancy/getter/strategies.go

View workflow job for this annotation

GitHub Actions / Init

syntax error: non-declaration statement outside function body

Check failure on line 104 in pkg/file/redundancy/getter/strategies.go

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest)

syntax error: non-declaration statement outside function body

Check failure on line 104 in pkg/file/redundancy/getter/strategies.go

View workflow job for this annotation

GitHub Actions / Test (flaky)

syntax error: non-declaration statement outside function body
Expand Down

0 comments on commit 4a81fc3

Please sign in to comment.