duke-git / lancet

A comprehensive, efficient, and reusable util function library of Go.

Home Page:https://www.golancet.cn/en/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

设置超时时间没有效果

djsxianglei opened this issue · comments

select {
case <-time.After(config.retryDuration):
case <-config.context.Done():
return errors.New("retry is cancelled")
}

=》
select {
case <-time.After(config.retryDuration):
return errors.New("timeout!!")
case <-config.context.Done():
return errors.New("retry is cancelled")
}

如果retryDuration超时应该返回,不然会继续执行下面

@djsxianglei retryDuration设置的不是超时,是两次重试的间隔时间