Skip to content

Commit 8ba131a

Browse files
committed
优化 Swoole HttpClient 重启逻辑
1 parent 30c330d commit 8ba131a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/YurunHttp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class YurunHttp
2424
/**
2525
* 版本号.
2626
*/
27-
const VERSION = '4.3';
27+
const VERSION = '5.0';
2828

2929
/**
3030
* 设置默认处理器类.

src/YurunHttp/Handler/Swoole.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ public function recvDefer($request, $timeout = null)
408408
}
409409
else
410410
{
411-
// 状态码为5XX或者0才需要重试
412-
$retry = (0 === $statusCode || (5 === (int) ($statusCode / 100)));
411+
// 状态码为5XX或者<0才需要重试
412+
$retry = ($statusCode <= 0 || (5 === (int) ($statusCode / 100)));
413413
}
414414
if ($retry)
415415
{

0 commit comments

Comments
 (0)