Skip to content

Commit

Permalink
优化 Swoole HttpClient 重启逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Jan 17, 2024
1 parent 30c330d commit 8ba131a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/YurunHttp.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class YurunHttp
/**
* 版本号.
*/
const VERSION = '4.3';
const VERSION = '5.0';

/**
* 设置默认处理器类.
Expand Down
4 changes: 2 additions & 2 deletions src/YurunHttp/Handler/Swoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ public function recvDefer($request, $timeout = null)
}
else
{
// 状态码为5XX或者0才需要重试
$retry = (0 === $statusCode || (5 === (int) ($statusCode / 100)));
// 状态码为5XX或者<0才需要重试
$retry = ($statusCode <= 0 || (5 === (int) ($statusCode / 100)));
}
if ($retry)
{
Expand Down

0 comments on commit 8ba131a

Please sign in to comment.