Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yf committed Dec 25, 2018
1 parent 17ec254 commit aa96e80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ private function createClient():Client

private function getUri(?string $path, ?string $query): string
{
if($path == null){
$path = '/';
}
return !empty($query) ? $path . '?' . $query : $path;
}
}
4 changes: 4 additions & 0 deletions src/Multi.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ function exec(float $timeout = 1.0):array
});
}
$ret = [];
$all = count($this->list);
$start = microtime(true);
while (1){
if(round(microtime(true) - $start,3) > $timeout ){
break;
}
if(count($ret) == $all){
break;
}
$temp = $channel->pop(0.01);
if(is_array($temp)){
$ret = $ret+$temp;
Expand Down

0 comments on commit aa96e80

Please sign in to comment.