Skip to content

Commit

Permalink
Merge pull request #538 from swoftcloud/master
Browse files Browse the repository at this point in the history
fixed rpc
  • Loading branch information
stelin authored Nov 18, 2019
2 parents 3dd205e + 451f09f commit 16557ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/framework/src/Timer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Timer
* @param array ...$params
*
* @return int
* @throws Exception\SwoftException
*/
public static function tick(int $msec, $callback, ...$params): int
{
Expand Down Expand Up @@ -53,7 +52,6 @@ public static function tick(int $msec, $callback, ...$params): int
* @param array ...$params
*
* @return int
* @throws Exception\SwoftException
*/
public static function after(int $msec, $callback, ...$params): int
{
Expand Down Expand Up @@ -124,7 +122,6 @@ public static function stats(): array

/**
* @return array
* @throws Exception\SwoftException
*/
private static function getLogItems(): array
{
Expand All @@ -141,7 +138,6 @@ private static function getLogItems(): array
/**
* @param array $items
*
* @throws Exception\SwoftException
*/
private static function initItems(array $items): void
{
Expand Down
10 changes: 8 additions & 2 deletions src/rpc-client/src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,17 @@ public function recv()
private function getHostPort(): array
{
$provider = $this->client->getProvider();
$list = $provider->getList($this->client);
if (empty($provider) || !$provider instanceof ProviderInterface || empty($list)) {
if (empty($provider) || !$provider instanceof ProviderInterface) {
return [$this->client->getHost(), $this->client->getPort()];
}

$list = $provider->getList($this->client);
if (empty($list)) {
throw new RpcClientException(
sprintf('Provider return list can not empty!')
);
}

if (!is_array($list)) {
throw new RpcClientException(
sprintf('Provider(%s) return format is error!', JsonHelper::encode($list))
Expand Down

0 comments on commit 16557ce

Please sign in to comment.