preflower / blog

preflower's blog
0 stars 0 forks source link

Exponential Backoff (指数退避算法) #30

Open preflower opened 2 years ago

preflower commented 2 years ago

参考

swr中的实践

const timeout =
    ~~(
      (Math.random() + 0.5) *
      (1 << (currentRetryCount < 8 ? currentRetryCount : 8))
    ) * config.errorRetryInterval

相关参数: