阅读(3560)
赞(3)
Laravel 8 retry() {#collection-method}
2021-07-05 10:24:21 更新
retry 函数尝试执行给定的回调,直到达到给定的最大尝试阈值。如果回调没有抛出异常,回调返回值将被返回。如果回调抛出异常,将自动重试。达到最大尝试次数,将抛出异常:
return retry(5, function () {
// Attempt 5 times while resting 100ms in between attempts...
}, 100); 
