mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix retry error missed (#10318)
Signed-off-by: godchen <qingxiang.chen@zilliz.com>
This commit is contained in:
parent
f68a3358dd
commit
cfe2546b0d
@ -32,15 +32,18 @@ func Do(ctx context.Context, fn func() error, opts ...Option) error {
|
||||
|
||||
for i := uint(0); i < c.attempts; i++ {
|
||||
if err := fn(); err != nil {
|
||||
if ok := IsUncoverable(err); ok {
|
||||
return err
|
||||
}
|
||||
|
||||
el = append(el, err)
|
||||
|
||||
if ok := IsUncoverable(err); ok {
|
||||
return el
|
||||
}
|
||||
|
||||
select {
|
||||
case <-time.After(c.sleep):
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
el = append(el, ctx.Err())
|
||||
return el
|
||||
}
|
||||
|
||||
c.sleep *= 2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user