Skip to content

Commit

Permalink
fix cache startup (#1414)
Browse files Browse the repository at this point in the history
Signed-off-by: kim <grufwub@gmail.com>
  • Loading branch information
NyaaaWhatsUpDoc authored Feb 3, 2023
1 parent 33aee1b commit abe9447
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/cache/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ func (*nocopy) Unlock() {}

// tryUntil will attempt to call 'do' for 'count' attempts, before panicking with 'msg'.
func tryUntil(msg string, count int, do func() bool) {
for i := 0; i < count && !do(); i++ {
for i := 0; i < count; i++ {
if do() {
return
}
}
log.Panicf("failed %s after %d tries", msg, count)
}

0 comments on commit abe9447

Please sign in to comment.